RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomImageList.AddMasked Method

Adds an image to the image list along with a color which is used to generate the transparent mask.

Pascal
function AddMasked(Image: TBitmap; MaskColor: TColor): Integer;
C++
__fastcall int AddMasked(TBitmap Image, TColor MaskColor);

AddMasked is similar to Add except that a mask bitmap is not specified. Instead, a color that can be used to automatically generate the masks is specified. Each pixel of the specified color in the image bitmap is changed to black, and the corresponding bit in the mask is set to one. As a result, any pixel in the image that matches the specified color is transparent when the image is drawn. AddMasked returns -1 if it fails, 0 if it's successful. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!