Sign in Join
FPDoc Onlineexperiment

TCustomImageList.AddSliceCentered function

Member of TCustomImageListpublicIn unit ImgList

Adds an image centered in the height and width for the image resolutions.

Declaration

pascal
function AddSliceCentered(Image: TCustomBitmap): Integer

Arguments

Image

Image content added in the method.

Function result

Ordinal position where the image was stored in the image resolutions.

Description

AddSliceCentered is an Integer function used to add the specified image to each of the resolutions in the image list.

Image is a TCustomBitmap instance that contains the image data used in the operation. A TRect instance is created which uses the values in the Height and Width properties for the default resolution. The image rectangle is used to center the image content using the height and width for the image.

AddSliceCentered calls the AddSlice method using Image and the calculated image rectangle as arguments. AddSlice scales the image to the dimensions needed for each image resolution, and stores the scaled image data.

The return value contains the ordinal position where the image was stored in each of the images resolutions for the image list.

See also

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