[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'ImgList' (#lcl)

# TCustomImageList.AddMasked

Adds an image(s) to the list using the MaskColor for transparent pixels.

## Declaration

Source position: imglist.pp line 350

`public function TCustomImageList.AddMasked(`
`Image: TBitmap;`
`MaskColor: TColor`
`):Integer;`

## Arguments

`Image` |  | The bitmap to be added to the image list.
`MaskColor` |  | The color used as the transparent pixels in the image(s).

## Function result

The index of the first added image, -1 if unsuccessful.

## Description

AddMasked is an Integer function used to add one or more images specified in Image to the image list. Image can contain multiple images of the same width and height. The total image width must be a multiple of the Width property, and the image height must be the same as the Height property.

Every pixel in the image(s) with the color in MaskColor will become transparent in the stored image(s).