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

# TCustomIcon.ExportImage

Exports the image for the icon at the specified index to another TFPImageBitmap class instance.

## Declaration

Source position: graphics.pp line 1672

`public function TCustomIcon.ExportImage(`
`AIndex: Integer;`
`AImageClass: TFPImageBitmapClass`
`):TFPImageBitmap;`

## Arguments

`AIndex` |  | Ordinal position for the icon exported in the method.
`AImageClass` |  | Graphics class for the exported image.

## Function result

Image instance created in the method where the exported icon is stored.

## Description

ExportImage creates a new instance of the bitmap image class specified in AImageClass, then calls its LoadFromRawImage method to load the raw image data for the shared icon. AIndex specifies the ordinal position in the Images for the the shared icon instance.

Remark: | To avoid memory leaks, the bitmap instance created in the return value must be destroyed in the calling routine.

## Version info

Added in LCL version 4.2.

## See also

TCustomIcon.Count |  | Number of images in the image list for the shared icon.
TRasterImage.FSharedImage |  | Shared image with existing handles, canvases, etc.
TRasterImage.LoadFromRawImage |  | Loads image data from the specified TRawImage instance.
TPicture.SaveToStreamWithFileExt |  | Saves graphic image data to a stream using the specified format and file extension.