C# Класс BrightIdeasSoftware.Utilities.ImagelistAdd

This class contains static methods to overcome the problems with the imagelist control and 32bit alphablended images. The methods allow you to add alphablended images to an existing imagelist control from an external image or icon file, an embedded resource, extracted file icon and extracted file extension icon.
Показать файл Открыть проект

Открытые методы

Метод Описание
AddEmbeddedResource ( string resourceName, ImageList destinationImagelist ) : void

Adds a 32bit alphablended icon or image to an existing imagelist from an embedded image or icon.

AddFromFile ( string fileName, ImageList destinationImagelist ) : void

Adds an alphablended icon or image to an existing imagelist from an external image or icon file.

AddFromImage ( Icon sourceIcon, ImageList destinationImagelist ) : void

Adds an alphablended icon to an existing imagelist from an Icon object.

AddFromImage ( Image sourceImage, ImageList destinationImagelist ) : void

Adds an alphablended image to an existing imagelist from an Image object.

AddIconOfFile ( string fileName, IconSizeZ IconSizeZ, bool selectedState, bool openState, bool linkOverlay, ImageList destinationImagelist ) : void

Extracts the icon of an existing file or folder on the system and adds the icon to an imagelist.

AddIconOfFile ( string fileName, ImageList destinationImagelist ) : void

Extracts the icon of an existing file or folder on the system using default parameters and adds the icon to an imagelist.

AddIconOfFileExt ( string fileExtension, IconSizeZ IconSizeZ, bool selectedState, bool openState, bool linkOverlay, ImageList destinationImagelist ) : void

Extracts a file extension icon from the system and adds the icon to an imagelist.

AddIconOfFileExt ( string fileExtension, ImageList destinationImagelist ) : void

Extracts a file extension icon from the system using default parameters and adds the icon to an imagelist.

Приватные методы

Метод Описание
Add ( Bitmap bm, ImageList il ) : void

This method is used to add alphablended images to an imagelist using win32 api functions to overcome the broken .Add() method of the imagelist control which loses the alphablend info of images.

Add ( string pszPath, ImageList il, uint uFlags ) : void

This method is used to add alphablended system icons to an imagelist using win32 api. This an added feature which is not included in the framework.

CreateDIBSection ( IntPtr hdc, [ pbmi, uint iUsage, IntPtr &ppvBits, IntPtr hSection, uint dwOffset ) : IntPtr
DestroyIcon ( IntPtr hIcon ) : IntPtr
ImageList_Add ( IntPtr hImageList, IntPtr hBitmap, IntPtr hMask ) : bool
ImagelistAdd ( ) : System
RtlMoveMemory ( IntPtr dest, IntPtr source, int dwcount ) : bool
SHGetFileInfo ( string pszPath, uint dwFileAttributes, SHFILEINFO &psfi, uint cbSizeFileInfo, uint uFlags ) : IntPtr

Описание методов

AddEmbeddedResource() публичный статический Метод

Adds a 32bit alphablended icon or image to an existing imagelist from an embedded image or icon.
public static AddEmbeddedResource ( string resourceName, ImageList destinationImagelist ) : void
resourceName string
destinationImagelist System.Windows.Forms.ImageList
Результат void

AddFromFile() публичный статический Метод

Adds an alphablended icon or image to an existing imagelist from an external image or icon file.
public static AddFromFile ( string fileName, ImageList destinationImagelist ) : void
fileName string
destinationImagelist System.Windows.Forms.ImageList
Результат void

AddFromImage() публичный статический Метод

Adds an alphablended icon to an existing imagelist from an Icon object.
public static AddFromImage ( Icon sourceIcon, ImageList destinationImagelist ) : void
sourceIcon System.Drawing.Icon The Icon object to add to the imagelist
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the icon to.
Результат void

AddFromImage() публичный статический Метод

Adds an alphablended image to an existing imagelist from an Image object.
public static AddFromImage ( Image sourceImage, ImageList destinationImagelist ) : void
sourceImage Image The Image object to add to the imagelist.
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the image to.
Результат void

AddIconOfFile() публичный статический Метод

Extracts the icon of an existing file or folder on the system and adds the icon to an imagelist.
public static AddIconOfFile ( string fileName, IconSizeZ IconSizeZ, bool selectedState, bool openState, bool linkOverlay, ImageList destinationImagelist ) : void
fileName string A file or folder path to extract the icon from.
IconSizeZ IconSizeZ The size to extract.
selectedState bool A flag to add the selected state of the icon.
openState bool A flag to add the open state of the icon.
linkOverlay bool A flag to add a shortcut overlay to the icon.
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the extracted icon to.
Результат void

AddIconOfFile() публичный статический Метод

Extracts the icon of an existing file or folder on the system using default parameters and adds the icon to an imagelist.
public static AddIconOfFile ( string fileName, ImageList destinationImagelist ) : void
fileName string A file or folder path to extract the icon from.
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the extracted icon to.
Результат void

AddIconOfFileExt() публичный статический Метод

Extracts a file extension icon from the system and adds the icon to an imagelist.
public static AddIconOfFileExt ( string fileExtension, IconSizeZ IconSizeZ, bool selectedState, bool openState, bool linkOverlay, ImageList destinationImagelist ) : void
fileExtension string A file extension to extract the icon from.
IconSizeZ IconSizeZ The size to extract.
selectedState bool A flag to add the selected state of the icon.
openState bool A flag to add the open state of the icon.
linkOverlay bool A flag to add a shortcut overlay to the icon.
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the extracted icon to.
Результат void

AddIconOfFileExt() публичный статический Метод

Extracts a file extension icon from the system using default parameters and adds the icon to an imagelist.
public static AddIconOfFileExt ( string fileExtension, ImageList destinationImagelist ) : void
fileExtension string A file extension to extract the icon from.
destinationImagelist System.Windows.Forms.ImageList An existing imagelist to add the extracted icon to.
Результат void