IconsCombine(Bitmap, Color, Boolean) 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,
	bool forceUncompressedResult
)

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.
forceUncompressedResult  Boolean
to force returning an uncompressed icon; to allow PNG compression, which is supported by Windows Vista and above.

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(Boolean, 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.

See Also