This documentation is for the old version. Go to the latest Graphics Mill docs

ColorPalette.SetColorKey Method (RgbColor)

Makes palette entry closest to given color transparent.

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Sub SetColorKey ( _
	color As RgbColor _
)
C#
public void SetColorKey(
	RgbColor color
)

Parameters

color

Type: Aurigma.GraphicsMill.RgbColor

Color which should be transparent in the bitmap.

Remarks

Alpha channel of given entry will be dropped to 0, alpha channels of all other entries will be set to 255. This way palette will contain only the single transparent index. This way palette will contain only the single transparent index. If you need more than one transparent entry, put transparent RgbColor into appropriate Item[Int32].

This method can be treated as analogue of Transparentize transform for non-indexed image.

Note

Setting transparent index works noticeable faster than setting transparent color (which actually calls slow FindNearestIndex(RgbColor) method). That's why it is highly recommended to pass index instead of color where possible.

Examples

Visual Basic
Dim red As Aurigma.GraphicsMill.RgbColor = _
 Aurigma.GraphicsMill.RgbColor.Red

palette.SetColorKey(red)
C#
Aurigma.GraphicsMill.RgbColor red = Aurigma.GraphicsMill.RgbColor.Red;

palette.SetColorKey(red);

See Also

Reference