I create a Bitmap and initialize it:
Bitmap := TBitmap.Create;
try
Bitmap.PixelFormat := TPixelFormat.pf32bit; // 32bit bitmap
Bitmap.AlphaFormat := TAlphaFormat.afDefined; // Enable alpha channel
Bitmap.SetSize(500, 500); // Set the bitmap to a custom size
// Fill Bitmap background with transparency:
Bitmap.Canvas.Brush.Color := clNone;
Bitmap.Canvas.FillRect(Rect(0, 0, Bitmap.Width, Bitmap.Height));
Bitmap.SaveToFile('EmptyBitmap.bmp');
Then I draw on the Bitmap with another component and then save it as a .BMP file again:
Bitmap.SaveToFile('ReadyBitmap.bmp');
Then I assign the Bitmap to an ImageEnView:
ImageEnView1.Assign(Bitmap);
ImageEnView1.Update;
ImageEnView1.IO.SaveToFileBMP('ImageEnBitmap.bmp');
Unfortunately, the background of the image is NOT TRANSPARENT. Here is a screenshot of ImageEnView1:

Here are the .BMP files saved from the various stages of the procedure:
attach/PeterPanino/2021315151555_Bitmaps.zip
15.54 KB
If you analyze the attached file ReadyBitmap.bmp you can see that the background is still transparent!
How can I make the image background transparent in the ImageEnView?