Contains definitions for TCustomImageList. base class for TImageList
TChangeLink
- class to notify when an Imagelist changes
Change
- software emulation of the OnChange event
OnChange
- event handler for a change in the Imagelist
Sender
- the imagelist that has notified us of a change
Base class for TImageList (not the same as a TBitmap collection)
An ImageList contains images (bitmaps or icons) of the same Width and Height, accessible by index. The images are stored in one big (wide) bitmap, whose width is Width*Count. When an image of a different Width or Height is inserted, the previous contents of the list are discarded!

It's okay, however, to insert an imagelist-like bitmap, that contains multiple bitmaps of the same Width and Height as used by the ImageList. This allows to insert e.g. other (compatible) ImageLists, or bitmaps for multiple states of essentially the same image (button pressed, released and disabled).

Transparency is implemented in the alpha channel of the raw 32 bit RGBA imagedata array - but not all platforms support such an alpha channel. [What exactly does this mean to the user?]

The painting of an image from the list is handled by the widgetset, no bitmap or icon component is involved. The widgetset can use a different internal organization of the data, optimized for immediate painting of an image.

NOTE: A TCustomImageList is not a TBitmap collection. If a storage of distinct bitmaps is needed, create your own list of TBitMaps (array or TList).
Currently only the insertion of Bitmaps is supported. Other image types should be rendered as bitmaps of Width and Height, which then can be inserted.
Initialize
- sets up the list
DefineProperties
- defines the properties of the ImageList (stored in a file)
SetWidthHeight
- specifies the dimensions for display
Writes the ImageList data into the stream
Restores the ImageList data from the stream
BeginUpdate
- start updating the data
Use together with EndUpdate to speed up the insertion of multiple images.

Every BeginUpdate must be matched by an EndUpdate, i.e. update operations can be nested.
EndUpdate
- finish updating the data
Decrements the internal UpdateCount and, when it reaches zero, does whatever is required to reflect the new content.
Add
an Image and Mask bitmap to the list. Returns the index of the added image or -1 if unsucessful
Adds an icon to the list (not yet!), returning the index of the icon or -1 if not successful
Adding graphics other than bitmaps can be implemented by converting the graphics item into a bitmap, which then can be added to the image list. Most graphics classes support such a conversion, so that specialized methods are redundant.
AddImages
- adds images from another imagelist to the list
Both lists must have the same image Width and Height, else the old images are discarded.
AddMasked
- adds one or more bitmaps to the list
Every pixel of MaskColor will become transparent.

Image can contain multiple images of the same Width and Height.

Returns the index of the first added bitmap, or -1 if unsuccessful.
Change
- send change notifications
Notifies all members of the ChangeLinkList, and calls the OnChange handler.
Clear
- removes all images from the list
Initialize the list for image(s) with the given height and width
The Width and Height is reset with every insertion of a bitmap. It may be useful, however, to initialize a list for the insertion of graphics other than bitmaps, so that the images can be rendered as bitmaps of the intended width and height, before they are inserted.
Delete the specified image
Paint an image
Paints the image specified by AIndex on Canvas at position AX, AY.
Copies the selected image into the given bitmap
GetHotSpot
- returns the co-ordinates for the hotspot of the drag image
Insert
one or more images into the list at the index position.
The insterted bitmap can consist of multiple images, of the same width and height, which become accessible as distinct images in the ImageList.

The height of the inserted images must match the ImageList height, else the ImageList content is replaced by the added images. The width must be a multiple of the ImageList width, so that the list always contains an integral number of images.

If Mask is nil, the inserted images have no transparent parts.
InsertMasked
- adds one or more transparent bitmaps to the list.
MaskColor is the RGB color of the transparent pixels. Every occurence of a MaskColor pixel will be converted into a transparent pixel.
Move
an image from index CurIndex to NewIndex
Replace
an indexed image with the Bitmap given
AMask can be nil, if the image has no transparent parts.
ReplaceMasked
- replaces the indexed image with the image given.
Every instance of MaskColor will be converted to transparent
Registers an object to get notified of a change of the imagelist
UnRegisterChanges
- remove the changes from the register
AllocBy
- allocate images by an integer value
BlendColor
- the colour for a blend
BkColor
- background colour (default none)
Count
- number of images in the list
DrawingStyle
- focus, selected, normal or transparent
Height
of images on list
Width
of images on list
OnChange
- event handler for a change in the imagelist
Masked
- if True, a mask is applied to the bitmap
ShareImages
- if True, images are allowed to be shared
ImageType
- an image or a mask
AValue
- the ImageList containing images to add
AddLazarusResource
- load TBitmap from lazarus resources and add it
FillDescription
- fills the description with the default info of the imagedata
GetRawImage
- primitive method for loading an image: you have to fill in all the description fields yourself
Reference
to the imagelist
CheckIndex
- method for checking whether the indexed item is supposed to be inserted (default condition is False)
GetReferenceHandle
- returns a handle for the reference
WSCreateReference
- creates a reference for the Imagelist (returns this as a result), passing the defined parameters for the creation process
StretchDraw
- draw the image to fill the canvas
Check for equivalence with another ImageList
This is an expensive operation, since both imagelists are written into memory streams, which then are compared bytewise.
Copies the image description and the data pointer