What I wanted to do is to copy an image from image list to bitmap b2, next write text on this b2 bitmap, then paste it to bitmap of the image.
Image must be transparent.
When I copy bitmap from TImageList to bitmap b2 and copy it to bitmap b the result is correct.
But when I copy image from the ImageList to bitmap b2 then write some text on it and next copy b2 to b1 then in place of written text a transparent rectangle is displayed. I save the image of b2 into the file and I see that text on b2 is correct. The bug seems to be in Draw function which copies the image from b2 into b or maybe I something in wrong way.
Image.Transparent := True;
b := Image.Picture.Bitmap;
b.PixelFormat := pf32bit;
b.Transparent := True;
b.TransparentColor := clFuchsia;
b.TransparentMode := tmFixed;
b.Canvas.CopyMode := cmSrcCopy;
b.Canvas.Brush.Style := bsSolid;
b.Canvas.Brush.Color := b.TransparentColor;
b.Canvas.FillRect(0,0,w,h);
b2 := TBitmap.Create;
b2.PixelFormat := pf32bit;
dm.il64x50.GetBitmap(1, b2);
b2.Canvas.Font.Size := 8;
b2.Canvas.Brush.Color := clFuchsia;
b2.Canvas.Brush.Style := bsSolid;
b2.Canvas.Font.Style := [];
b2.Canvas.Font.Color := clBlack;
b2.Canvas.TextOut(10,40, 'XXXXXXX');
b2.SaveToFile('d:\xx.bmp'); // here transparent text is visible
b.Canvas.Draw(0,(w-64) div 2, b2); // here the text is not visible, just empty rectangle is visible in place of the text
b2.Free;
Lazarus 2.1 (svn) on Windows 10 1809 64-bit