Table of Contents

Class ShellIcon

Namespace
ExControls
Assembly
ExControls.dll

Represents a Windows icon, which is a small bitmap image that is used to represent an object. Icons can be thought of as transparent bitmaps, although their size is determined by the system.

public sealed class ShellIcon : IDisposable
Inheritance
ShellIcon
Implements
Inherited Members

Constructors

ShellIcon(ShellIconType, ShellIconSize, bool, bool, bool)

Initializes a new instance of the ShellIcon class and loads the system stock icon of the specified type and size.

public ShellIcon(ShellIconType type, ShellIconSize size = ShellIconSize.Normal, bool selected = false, bool linkOverlay = false, bool useShellIconSize = false)

Parameters

type ShellIconType

Type of the ShellIcon.

size ShellIconSize

Size of the ShellIcon.

selected bool

Selected style of the icon.

linkOverlay bool

Link overlay of the icon.

useShellIconSize bool

Use shell size of the icon instead of the system size metrics.

Properties

Disposed

Gets whether this instance was disposed.

public bool Disposed { get; }

Property Value

bool

Handle

Gets a Handle of the ShellIcon.

public nint Handle { get; }

Property Value

nint

Index

Gets an index of this icon in system's internal ImageList.

public int Index { get; }

Property Value

int

LinkOverlay

Modifies the ShellIcon value by causing the function to add the link overlay to the file's icon.

public bool LinkOverlay { get; }

Property Value

bool

Selected

Modifies the ShellIcon by causing the function to blend the icon with the system highlight color.

public bool Selected { get; }

Property Value

bool

Size

Size of the ShellIcon.

public ShellIconSize Size { get; }

Property Value

ShellIconSize

Type

Gets the type of ShellIcon.

public ShellIconType Type { get; }

Property Value

ShellIconType

UseShellIconSize

Modifies the Size of ShellIcon by causing the function to retrieve the Shell-sized icons rather than the sizes specified by the system metrics.

public bool UseShellIconSize { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~ShellIcon()

protected ~ShellIcon()

ToBitmap()

Converts ShellIcon to Bitmap image.

public Bitmap ToBitmap()

Returns

Bitmap

a new bitmap with the icon

Operators

implicit operator Icon(ShellIcon)

Converts ShellIcon to Icon that uses the same handle (it stays valid only until the ShellIcon is disposed).

public static implicit operator Icon(ShellIcon icon)

Parameters

icon ShellIcon

the shell icon

Returns

Icon

icon with the handle of icon