IconsFromExtension Method

Gets the system-associated icon of a file or an extension.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
C#
public static Icon FromExtension(
	string fileOrExtension,
	SystemIconSize size
)

Parameters

fileOrExtension  String
A file name (can be a non-existing one) or an extension (with or without a leading dot character) for which the associated icon is about to be retrieved.
size  SystemIconSize
The size of the icon to be retrieved.

Return Value

Icon
The system-associated icon of the specified file or extension.

Remarks

If size is Large and fileOrExtension is an existing file, then the result is usually the same as for the Icon.ExtractAssociatedIcon method.

See Also