IconExtensions Class

Provides extension methods for the Icon type.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
C#
public static class IconExtensions
Inheritance
Object    IconExtensions

Remarks

  Note

When targeting .NET 7.0 or later versions this class is supported on Windows only.

Methods

Combine(Icon, IEnumerableBitmap) Combines an Icon instance with the provided images into a multi-resolution Icon instance.
Combine(Icon, IEnumerableIcon) Combines an Icon instance with the provided icons into a multi-resolution Icon instance.
Combine(Icon, Bitmap) Combines an Icon instance with the provided images into a multi-resolution Icon instance.
Combine(Icon, Icon) Combines an Icon instance with the provided icons into a multi-resolution Icon instance.
Combine(Icon, Boolean, IEnumerableBitmap) Combines an Icon instance with the provided images into a multi-resolution Icon instance.
Combine(Icon, Boolean, IEnumerableIcon) Combines an Icon instance with the provided icons into a multi-resolution Icon instance.
Combine(Icon, Boolean, Bitmap) Combines an Icon instance with the provided images into a multi-resolution Icon instance.
Combine(Icon, Boolean, Icon) Combines an Icon instance with the provided icons into a multi-resolution Icon instance.
Combine(Icon, Bitmap, Color) Combines an Icon instance with the provided image into a multi-resolution Icon instance.
Combine(Icon, Bitmap, Color, Boolean) Combines an Icon instance with the provided image into a multi-resolution Icon instance.
ExtractBitmap(Icon, Boolean) Extracts the first image from an Icon instance. If the icon has only one image consider to use ToAlphaBitmap, which is faster.
ExtractBitmap(Icon, Size, Boolean) Extracts the first image of specified size from an Icon instance.
ExtractBitmap(Icon, Int32, Boolean) Extracts the image of specified index from an Icon instance.
ExtractBitmap(Icon, Size, PixelFormat, Boolean) Extracts the image of specified size and pixel format from an Icon instance.
ExtractBitmaps(Icon, Boolean) Extracts every image from an Icon instance.
ExtractBitmaps(Icon, PixelFormat, Boolean) Extracts every image of specified pixel format from an Icon instance.
ExtractBitmaps(Icon, Size, Boolean) Extracts every image of specified size from an Icon instance.
ExtractIcon(Icon, Size) Extracts the first icon of specified size from an Icon instance. Unless the Icon constructors, this method works as expected.
ExtractIcon(Icon, Int32) Extracts the icon of specified index from an Icon instance.
ExtractIcon(Icon, Size, Boolean) Extracts the first icon of specified size from an Icon instance. Unless the Icon constructors, this method works as expected.
ExtractIcon(Icon, Size, PixelFormat) Extracts the icon of specified size and pixel format from an Icon instance. Unless the Icon constructors, this method works as expected.
ExtractIcon(Icon, Int32, Boolean) Extracts the icon of specified index from an Icon instance.
ExtractIcon(Icon, Size, PixelFormat, Boolean) Extracts the icon of specified size and pixel format from an Icon instance. Unless the Icon constructors, this method works as expected.
ExtractIcons(Icon) Extracts every icon from an Icon instance as separated Icon instances.
ExtractIcons(Icon, Boolean) Extracts every icon from an Icon instance as separated Icon instances.
ExtractIcons(Icon, PixelFormat) Extracts every icon of specified pixel format from an Icon instance as separated Icon instances.
ExtractIcons(Icon, Size) Extracts every icon of specified size from an Icon instance as separated Icon instances.
ExtractIcons(Icon, PixelFormat, Boolean) Extracts every icon of specified pixel format from an Icon instance as separated Icon instances.
ExtractIcons(Icon, Size, Boolean) Extracts every icon of specified size from an Icon instance as separated Icon instances.
ExtractNearestBitmap Extracts the nearest image of specified size and pixel format from an Icon instance.
ExtractNearestIcon(Icon, Size, PixelFormat) Extracts the nearest icon of specified size and pixel format from an Icon instance. Unless the Icon constructors, this method works as expected.
ExtractNearestIcon(Icon, Size, PixelFormat, Boolean) Extracts the nearest icon of specified size and pixel format from an Icon instance. Unless the Icon constructors, this method works as expected.
GetBitsPerPixel Gets the bits per pixel (BPP) value of the icon.
GetIconInfo(Icon) Gets an array of IconInfo instances containing information about the images of an Icon.
GetIconInfo(Icon, Int32) Gets an IconInfo instance containing information about an Icon image of the specified index.
GetImagesCount Gets the number of images in the icon.
IsCompressed Determines whether the icon or its image at the specified index is compressed.
SaveAsIcon Saves the icon into the specified stream. Unlike Icon.Save, this method can save every icon with high quality, even SystemIcons members, and icons created by the Icon.FromHandle method.
ToAlphaBitmap Converts the specified icon to a Bitmap. While Icon.ToBitmap may return a wrong result when icon contains semi-transparent pixels, this method returns an image, in which alpha channel is always correctly applied for the image.
ToCursorHandle Converts the provided icon to a CursorHandle, which can be passed to the System.Windows.Forms.Cursor constructor to create a new cursor that supports colors and partial transparency.
ToMultiResBitmap(Icon) Converts the icon to a Bitmap instance, which contains every image of the icon. When the returned Bitmap is used to create another Bitmap or is drawn into a Graphics, the best-fitting image is automatically applied.
ToMultiResBitmap(Icon, Boolean) Converts the icon to a Bitmap instance, which contains every image of the icon. When the returned Bitmap is used to create another Bitmap or is drawn into a Graphics, the best-fitting image is automatically applied.
Obsolete.
ToUncompressedIcon Converts the icon to an uncompressed one.

See Also