Show / Hide Table of Contents

Class icon

Gets icons from/of files etc. Contains native icon handle.

public class icon : IDisposable
Remarks

Native icons must be destroyed. An icon variable destroys its native icon when disposing. To dispose, call Dispose or use using statement. Or use functions like icon.ToGdipBitmap, icon.ToWpfImage; by default they dispose the icon variable. It's OK to not dispose if you use few icons; GC will do it.


Namespace: Au
Assembly: Au.dll
Inheritance
object
icon

Constructors

Name Description
icon(nint)

Sets native icon handle. The icon will be destroyed when disposing this variable or when converting to object of other type.

Properties

Name Description
Handle

Gets native icon handle.

Size

Gets icon size.

debugSpeed

If not 0, "get icon" functions of this class will print (in editor's output) their execution time in milliseconds when it >= this value.

Methods

Name Description
Detach()

Clears this variable and returns its native icon handle.

Dispose()

Destroys native icon handle.

Dispose(bool)
SetWindowIcon(wnd, bool)

Sends WM_SETICON message.

ToGdipBitmap(bool)

Converts native icon to GDI+ bitmap object.

ToGdipIcon()

Creates System.Drawing.Icon object that shares native icon handle with this object.

ToWpfImage(bool)

Converts native icon to WPF image object.

create(int, int, Action<Graphics>)

Creates icon at run time.

load(string, int, int)

Extracts icon directly from file.

of(string, int, IconGetFlags)

Gets icon that can be displayed for a file, folder, shell object, URL or file type.

ofPidl(Pidl, int)

Gets icon of a file or other shell object specified as ITEMIDLIST.

ofThisApp(int, int)

Gets icon from unmanaged resources of this program.

ofWindow(wnd, int)

Gets icon that is displayed in window title bar and in taskbar button.

parsePathIndex(string, out string, out int)

Parses icon location string.

stock(StockIcon, int)

Gets a shell stock icon.

trayIcon(int)

Gets icon of tray icon size from unmanaged resources of this program or system.

trayIcon(string)

Loads icon of tray icon size from .ico file.

winStoreAppImage(Pidl, int)

Gets image of a Windows Store App. This overload accepts a Pidl instead of a shell string.

winStoreAppImage(string, int)

Gets image of a Windows Store App.

Operators

Name Description
implicit operator nint(icon)

Gets native icon handle.