IconsCombine(Bitmap, Color) Method

Combines the provided images into a multi-resolution Icon instance.

Definition

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 10.1.0
C#
public static Icon? Combine(
	Bitmap[]? images,
	Color[]? transparentColors
)

Parameters

images  Bitmap
The images to be added to the icon. Images can be non-squares ones.
transparentColors  Color
An array of transparent colors of the images. The array must have as many elements as images.

Return Value

Icon
An Icon instance that contains every image of the source images.

Remarks

The elements of images may contain multiple icons.

This overload attempts to preserve the actual pixel format of the specified images, and just applies a transparency mask using the specified colors. To allow reducing the color depth losslessly, use the Combine(Bitmap) overload instead.

If an element of transparentColors is an opaque color and the corresponding item in images already has transparent pixels, then both the originally transparent pixels, and the ones that equal to the specified color will be transparent in the result.

The result Icon is compatible with Windows XP if the method is executed in a Windows XP environment.

See Also