Replaces the icon at the specified position in all resolutions for the image list.
Source position: imglist.pp line 390
public procedure TCustomImageList.ReplaceIcon( |
AIndex: Integer; |
AIcon: TCustomIcon |
); |
AIndex |
|
Ordinal position for the icon replaced in the method. |
AIcon |
|
Icon stored in the method. |
ReplaceIcon is a procedure used to replace the icon stored at the position specified in AIndex in all resolutions for the image list.
AIcon is a TCustomIcon type that contains the graphic image stored in the method. No actions are performed in the method when AIcon has not been assigned (contains Nil).
Icons can contain multiple sizes, and must be in ascending size order to ensure they are applied correctly to image resolutions. ReplaceIcon create a temporary TIcon instance that is used to sort the icons prior to updating the resolutions in the image list.
ReplaceIcon uses the Resolutions enumerator to update each of the image resolutions used in the image list. The GetBestIconIndexForSize method is called to determine the icon size used for each image resolution. The ScaleImage method is called to resize the icon to the width required for each image resolution. If the icon is Masked (has transparent areas), the handle for the bitmap mask is included in the image scaling process. The InternalReplace method in the image resolution is called to store the scaled 32-bit RGBA raw image data.
|
Provides access to the image resolutions (or sizes) used in the image lists. |
|
|
Scales an image and its optional mask to the specified target size. |
|
|
Provides multiple image resolutions in TCustomImageList. |
Lazarus Component Library (LCL) | Version 3.99-1b97b99691 (2024-09-01) | Home |