ImageEn, unit iexBitmaps

TIEBitmap.SetTransparentColors

TIEBitmap.SetTransparentColors


Declaration

procedure SetTransparentColors(MinColor, MaxColor: TRGB; Alpha: Integer); overload;
procedure SetTransparentColors(MinColor, MaxColor: TColor; Alpha: Integer); overload;


Description

Sets all pixels within the MinColor and MaxColor range as transparent. The level of transparency is specified by Alpha (0=fully transparent, 255=fully visible).
If you are sure of the transparent color, you can set MinColor and MaxColor to the same value.




Example

// Specify all colors from gray (128, 128, 128) to white (255, 255, 255) as transparent
MyBMP.SetTransparentColors( CreateRGB(128, 128, 128), CreateRGB(255, 255, 255), 0 );

// Set all white pixels as transparent
MyBMP.SetTransparentColors( clWhite, clWhite, 0 );


See Also

- CreateRGB
- TRGB2TColor
- TColor2TRGB