Sign in Join
FPDoc Onlineexperiment

TCustomImageList.Add function

Member of TCustomImageListpublicIn unit ImgList

Adds an image to the list using its source data and optional mask.

Declaration

pascal
function Add(Image: TCustomBitmap; Mask: TCustomBitmap): Integer

Arguments

Image

Bitmap image data added in the method.

Mask

A bitmap mask which defines the transparent parts of Image.

Function result

The index of the added image.

Description

Add is an Integer function used to to add the specified Image and its optional Mask to the image list.

Image is the TCustomBitmap instance with image data added in the method.

Mask is a TCustomBitmap instance which contains a monochrome bitmap which defines the transparent areas for the image. When Mask contains a valid bitmap, it is combined with the source data in Image before it is stored in the image list. When Mask contains Nil, the Image has no defined transparent areas.

The return values contains the ordinal position in the image list for the newly added image.

Add calls the Insert method to store Image and Mask in the image list. The Image and optional Mask are scaled and added to each of the defined Resolutions in the image list. No actions are performed in the method when Image has not been assigned (contains Nil).

Use AddMasked to add a masked image where MaskColor defines the transparent areas in the image.

Use the AddSlice method to store an image from source data in the image list storage format. Use the AddSliced method to store all images from source data in the image list storage format.

See also

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