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

# TCustomImageList.AddMultipleResolutions

Adds images with varying sizes to the corresponding image resolution.

## Declaration

Source position: imglist.pp line 343

`public function TCustomImageList.AddMultipleResolutions(`
`Images: array of TCustomBitmap`
`):Integer; function TCustomImageList.AddMultipleResolutions(`
`Images: array of TRasterImage`
`):Integer;`

## Arguments

`Images` |  | Array of images stored in the method.

## Function result

Ordinal position where images were stored in the various resolutions.

## Arguments

`Images` |  | Array of images stored in the method.

## Description

AddMultipleResolutions is an Integer function used to add images of varying sizes to the corresponding resolution in the image list.

AImages is an array of TCustomBitmap type with the images added in the method. Each image has a unique width that determines the image resolution where the image is stored. AImages must be sorted in ascending image width order before it is passed as an argument to the method.

The return value contains the ordinal position where the images were stored in the image resolutions. It should contain the value corresponding to Count-1 when the method is completed.

AddMultipleResolutions calls the CreateDefaultResolution method to ensure that the default image resolution has been created before adding images to the list.

The Resolutions enumerator is used to visit each of the TCustomImageListResolution instances used in the image list. Each image in AImages is compared to the image resolutions to determine if the width is already in use. If no exact match is found, the next larger image resolution is used. If no resolution is larger than the image width, the largest image resolution is used.

The ScaleImage method is called to resize the image in AImages to the height and width required for the target image resolution. The image is appended using the InternalInsert method in the image resolution to store the scaled raw image data.

## See also

TCustomImageList.Insert |  | Inserts an image into each image resolution at the specified position.
TCustomImageList.InsertIcon |  | Inserts an Icon into each of the resolutions for the image list.
TCustomImageList.InsertMasked |  | Inserts a transparent image into the image resolutions at the specified position.
TCustomImageList.Count |  | Number of images stored in the default resolution for the image list.
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.
TCustomImageListResolution |  | Implements an image resolution (or size) used in TCustomImageList.
TCustomImageListResolutions |  | Provides multiple image resolutions in TCustomImageList.