This utility class is used for manipulating icons.
Classes |
|
class | IconFileEntry |
Storage for entry information from the .ico
file. |
|
class | IconFileHeader |
Storage for the header information from the
.ico file. |
|
Static Public Member Functions |
|
static Icon | FromBitmap (Bitmap bitmap) |
Convert a bitmap to an GDI+ Icon (32bit
color). |
static Icon CSharpUtilities::IconUtilities::FromBitmap | ( | Bitmap | bitmap | ) | [inline, static] |
Convert a bitmap to an GDI+ Icon (32bit color).
The returned icon supports transparent color and alpha channel.
This is much better than Icon.FromHandle(bitmap.GetHIcon()). If you used the Bitmap.GetHIcon, you must explicitly depose that handle by calling win32 api: DestroyIcon. However, using out method here you don't need to worry about GDI resource leak because we perform the conversion based on data stream but not on GDI handles.
For more information, please reference: http://www.codeproject.com/dotnet/MultiIcon.asp