IconsFromFile(String, Int32) Method

Extracts the icon with the specified integer identifier from a file.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 10.0.0-rc.1
C#
public static Icon FromFile(
	string fileName,
	int id
)

Parameters

fileName  String
The name of the file. Can be an executable file, a .dll or icon file. If the extension is omitted, .dll is applied.
id  Int32
The integer identifier of the icon resource withing the file.

Return Value

Icon
The icon of the specified identifier.

Remarks

If fileName refers to an icon file it is recommended to use the Icon(String) constructor instead.

The images of an Icon can be extracted by the IconExtensions.ExtractBitmaps methods.

If fileName has no full path, then it refers to a system library. For example, Icons.FromFile("shell32", 13) loads a chip icon from shell32.dll.

  Note

This method is supported on Windows only.

See Also