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

# TSharedIcon

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a reference-counted shared Icon image type.

## Declaration

Source position: graphics.pp line 1541

`type TSharedIcon = class(TSharedRasterImage)`
`protected`
`procedure FreeHandle; override;` |  | Frees the handle for the shared reference-counted icon.
`procedure UpdateFromHandle(); virtual;` |  | Frees the existing icon image and reloads it from the specified handle.
`function IsEmpty; override;` |  | Indicates if the shared icon is empty (contains no icon images).
`function GetImage();` |  | Gets the value for the indexed Images property.
`public`
`constructor Create; override;` |  | Create - constructor for TSharedIcon: performs inherited Create then creates a list of images.
`destructor Destroy; override;` |  | Destroy - destructor for TSharedIcon: frees the list of images and performs inherited Destroy.
`procedure Clear;` |  | Clear - remove the icon and free its resources.
`procedure Delete();` |  | Removes the icon image with the specified index.
`function GetIndex();` |  | Gets the Index of an image with specified pixel format, height and width.
`class function GetImagesClass; virtual;` |  | Gets the class reference used to create a new icon image in the Images property.
`procedure Add();` |  | Adds the specified image to the list of Images in the icon.
`procedure Sort;` |  | Sorts values in Images using the IconCompare routine.
`function Count;` |  | Count - returns the number of references to the shared icon.
`property Images []: TIconImage; [r]` |  | Provides indexed access to the images available in the Icon.
`end;`

## Inheritance

`TSharedIcon` |  | Implements a reference-counted shared Icon image type.
`TSharedRasterImage` |  | Implements a reference counted raster image that may be shared between controls.
`TSharedImage` |  | Specifies the base class for reference-counted shared images.
`TObject`

## Description

TSharedIcon is a TSharedRasterImage descendant which implements a reference counted shared Icon. TSharedIcon provides access to the list of images available in the Icon as TIconImage instances using the Images property. Methods are provided to add, delete, clear, sort, and retrieve the images.

TSharedIcon is the type used to implement the internal shared image in TCustomIcon (and descendant classes).