TCustomImageList.InsertIcon procedure
Inserts an Icon into each of the resolutions for the image list.
Declaration
procedure InsertIcon(AIndex: Integer; AIcon: TCustomIcon)Arguments
AIndex | Position in the image list where the icon is inserted. |
AIcon | The Icon to insert into the image list. |
Description
InsertIcon is a procedure used to insert an icon at the specified
position in each of the resolutions for the image list.
AIndex contains the ordinal position in the image list where the
icon is stored.
AIcon is the TCustomIcon instance stored in the method. AIcon
allows multiple icon sizes to be available in the class instance. No actions
are performed in the method when AIcon is unassigned (contains
Nil).
To ensure that the icon sizes in AIcon are in ascending size order, a
temporary TIcon instance is created and its Sort method is called.
InsertIcon uses the Resolutions enumerator to visit each of the
image resolutions used in the image list. GetBestIconIndexForSize
is called for each image resolution to get the icon size for the width in the
resolution. ScaleImage is called to resize the icon bitmap and
mask (when present) to the height and width required for the image
resolution. The InternalInsert method in the image resolution is
called to store the scaled raw image data for the icon at the position in
AIndex.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
