Sign in Join
FPDoc Onlineexperiment

TRasterImage.TransparentColor property

Member of TRasterImagepublicIn unit Graphics

Color used to represent transparent pixels in the image.

Declaration

pascal
property TransparentColor: TColor read GetTransparentColor write SetTransparentColor default clDefault;

Description

TransparentColor is a TColor property which indicates the color used to represent transparent pixels in the raw image data. Pixels with this color are not drawn on the image - so they have a transparent appearance. The default value for the property is clDefault.

TransparentColor is used along with TransparentMode to determine whether a fixed color is used for transparency, or if the transparent color is read from a specified pixel in the raw image data.

When TransparentColor contains clDefault, the RequestTransparentColor method is used to get the transparency color value from the bottom-left pixel in the raw image data.

When setting a new value for the property, the TransparentMode property may be updated as well. When clDefault is assigned to the property, TransparentMode is set to tmAuto. For other color values, TransparentMode is set to tmFixed.

The ApplyTransparent method is called to apply the effective transparency for the image using the values in Transparent, TransparentColor, and TransparentMode.

Modified in LCL version 4.2 to call ApplyTransparent when the property value has been changed.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.