IconsFromExtension Method

KGy SOFT Drawing Libraries Help
Gets the system-associated icon of a file or an extension.

Namespace:  KGySoft.Drawing
Assembly:  KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 5.1.0
Syntax

public static Icon FromExtension(
	string fileOrExtension,
	SystemIconSize size
)

Parameters

fileOrExtension
Type: SystemString
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
Type: KGySoft.DrawingSystemIconSize
The size of the icon to be retrieved.

Return Value

Type: 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.

Note Note
On non-Windows platforms this method always returns the SystemIcons.WinLogo icon.
See Also

Reference