Skip to content

API Reference

Koray Üstündağ edited this page May 16, 2023 · 2 revisions

ShellIconExtractor Class

Constructor

ShellIconExtractor(string filePath, int iconIndex)

Creates a new instance of the ShellIconExtractor class with the specified file path and icon index.

  • Parameters:
    • filePath (string): The path of the file from which to extract the icon.
    • iconIndex (int): The index of the icon to extract from the file.

Methods

GetIcon(int size) : Icon

Gets the extracted icon with the specified size.

  • Parameters:

    • size (int): The size of the icon to retrieve.
  • Returns: An instance of the Icon class representing the extracted icon.

Exceptions

The ShellIconExtractor class can throw the following exceptions:

  • ArgumentException: Thrown if the arguments provided to the constructor are invalid.
  • InvalidOperationException: Thrown if the icon handle is invalid.
  • OutOfMemoryException: Thrown if there is not enough memory to create the icon.
  • Win32Exception: Thrown if an error occurs in the Win32 API calls.
  • ExternalException: Thrown if an external exception occurs.
  • NotSupportedException: Thrown if the operation is not supported.
  • Exception: Thrown for any other unhandled exception.

Clone this wiki locally