View Issue Details

IDProjectCategoryView StatusLast Update
0035585LazarusLCLpublic2019-05-15 14:16
ReporterKrzysztof StępieńAssigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
PlatformIntel x64OSWindows 10OS Version1809
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0035585: Writting on transparent Bitmap
DescriptionHello!

What I wanted to do is to copy an image from image list to bitmap b2, 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.
Steps To Reproduce
        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 := clYellow;
        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');

        b.Canvas.Draw(0,(w-64) div 2, b2);
        //b.Canvas.StretchDraw(rect(2,2,62,52), b2);
        b2.Free;
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetWin32/Win64
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-05-15 14:16 Krzysztof Stępień New Issue