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

# TMenuItem.GetImageList

Gets an image list with the available bitmaps for the menu item.

## Declaration

Source position: menus.pp line 264

`public procedure TMenuItem.GetImageList(`
`out aImages: TCustomImageList;`
`out aImagesWidth: Integer`
`); virtual; function TMenuItem.GetImageList: TCustomImageList;`

## Arguments

`aImages` |  | Output variable with the images available for the menu item.
`aImagesWidth` |  | Output variable with the width for the images in AImages.

## Function result

TCustomImageList with the bitmaps available for the menu item.

## Description

GetImageList is an overloaded method used to get the list of available images for the menu item. The images are retrieved from an ancestor menu item or the menu which contains the menu item.

AImages is an output variable with the TCustomImageList which contains the available images.

AImagesWidth is an output variable with the width for the bitmaps in the AImages argument.

When Parent has been assigned, the SubMenuImages property in an ancestor menu item is copied into the image list. The Width in the image list is used in the aImagesWidth argument.

When Parent has not been assigned, GetParentMenu is called to get the menu which contains the menu item. Its Images property is copied into the image list. The Width in the image list is used in the aImagesWidth argument.

The TCustomImageList instance is Nil (unassigned) if neither SubMenuImages nor Images can be retrieved for the menu item.

Use the ImageIndex property to specify which image is used for the menu item. Use Bitmap to access the image displayed for the menu item.

GetImageList is called when the value for the Bitmap property is read. The image list provides an image resolution with the image for the Bitmap property. It is also called from the HasIcon and GetIconSize methods.