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

# TCustomImageList.ReplaceSlice

Replace an image at the specified position with a slice from the specified image.

## Declaration

Source position: imglist.pp line 388

`public procedure TCustomImageList.ReplaceSlice(`
`AIndex: Integer;`
`Image: TCustomBitmap;`
`AImageRect: TRect;`
`const AllResolutions: Boolean = True`
`);`

## Arguments

`AIndex` |  | Ordinal position for the image updated in the method.
`Image` |  | Image with data stored in the method.
`AImageRect` |  | Defines the coordinates for the image stored in the method.
`AllResolutions` |  | Indicates if all image resolutions are updated in the method.

## Description

ReplaceSlice is a procedure used to replace an image at the specified index position with a portion (or slice) from the specified image.

AIndex contains the ordinal position of the image updated in the method.

Image is a TCustomBitmap type that contains image data stored in the method. No actions are performed in the method when Image has not been assigned (contains Nil).

AImageRect is a TRect type that defined the top, left, bottom, and right coordinates for the image data used in the method.

AllResolutions indicates if the image stored at the specified position is updated in all of the image resolutions for the image list. When AllResolutions contains False, only the image resolution using the width defined in ARect is updated in the method. When AllResolutions is True, the Resolutions enumerator is used to update each of the image resolutions used in the image list.

The ScaleImage method is called to resize the Image rectangle to the height and width required for the image resolution(s). The InternalReplace method in each image resolution is called to store the scaled 32-bit RGBA raw image data.

## See also

TCustomImageList.Resolutions |  | Provides access to the image resolutions (or sizes) used in the image lists.
TCustomImageList.ScaleImage |  | Scales an image and its optional mask to the specified target size.
TCustomImageListResolutions |  | Provides multiple image resolutions in TCustomImageList.