Declaration
procedure AddToImageList(Dest: TCustomImageList; Alpha32Bit: Boolean = true);
Description
Adds the image with its alpha channel to a TImageList.
If Alpha32Bit is True, the image is added with a 32bit alpha channel (range of alpha values). If false, it is added with a single alpha value.
Note:
◼This process will modify the PixelFormat to ie32RGB
◼If Alpha32Bit is true, you should set the ColorDepth of your ImageList to cd32bit (Not recommended for applications without theming)
// Add 32bit PNG images (with alpha channels) to a TImageList
ImageList.Clear();
ImageList.Height := 24;
ImageList.Width := 24;
ImageList.ColorDepth := cd32bit;
iebmp := TIEBitmap.Create();
iebmp.LoadFromFile('D:\TransparentImage1.png');
iebmp.AddToImageList( ImageList );
iebmp.LoadFromFile('D:\TransparentImage2.png');
iebmp.AddToImageList( ImageList );
iebmp.LoadFromFile('D:\TransparentImage3.png');
iebmp.AddToImageList( ImageList );
iebmp.LoadFromFile('D:\TransparentImage4.png');
iebmp.AddToImageList( ImageList );
iebmp.Free();
// Add all bitmaps of a TIEMultiBitmap to a TImageList
for i := 0 to mbmp.Count - 1 do
begin
bmp := mbmp.GetTIEBitmap( i );
bmp.AddToImageList( myImageList );
mbmp.ReleaseBitmap( i, False );
end;
See Also
◼SynchronizeRGBA
◼CopyToTBitmap