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)
Examples
// Add 32bit PNG images (with alpha channels) to a TImageList
ImageList.Clear();
ImageList.Height := 24;
ImageList.Width := 24;
ImageList.ColorDepth := cd32bit;
bmp := TIEBitmap.Create();
bmp.LoadFromFile('D:\TransparentImage1.png');
bmp.AddToImageList( ImageList );
bmp.LoadFromFile('D:\TransparentImage2.png');
bmp.AddToImageList( ImageList );
bmp.LoadFromFile('D:\TransparentImage3.png');
bmp.AddToImageList( ImageList );
bmp.LoadFromFile('D:\TransparentImage4.png');
bmp.AddToImageList( ImageList );
bmp.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