View Issue Details

IDProjectCategoryView StatusLast Update
0036383LazarusLCLpublic2019-12-02 14:15
Reporterjamie philbrookAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.0.6Product Build 
Target VersionFixed in Version 
Summary0036383: 32 bit bitmaps will not draw transparently due to incomplete code.
DescriptionI guess there was some work put in for Alpha blend 32 bit images using the alpha channel however, its not complete and thus is not useable. However, an option flag was included to use it thus disabling the abilities to use 32 bit images for transparencies.

In file CustomBitmap.Inc

Procedure TCustomBitmap.RawImageNeeded(…

Line 0000225 in 2.0.6 Laz release.

pf32bit: flags := [riqRGB, riqfMask, riqAlpha];

                                                            ^^^^^^^^^^
comment out riqAlpha and recompile...

It now works but I think a property should be inplace to select this in the future if they ever do get the Alpha blend functional.

At least for now we can use it.

Steps To Reproduceprocedure TForm1.Button1Click(Sender: TObject);
Var
  B:TBitmap;
begin
  B := TBitMap.Create;
  B.PixelFormat := pf32bit;
  B.SetSize(100,100);
  B.Transparent := True;
  B.TransparentMode := tmFixed;
  B.TransparentColor:= clblack;
  B.Canvas.Brush.Color := clblack;
  B.Canvas.FillRect(rect(0,0,100,100));
  B.Canvas.Brush.Style := bsClear;
  B.Canvas.Font.Color := clRed;
  B.Canvas.TextOut(0,0,'TEST');
  canvas.Draw(0,0,B);
  B.Free;

end;
The above will fail to draw a transparent image until you do the fix.
            
TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

jamie philbrook

2019-11-30 04:03

reporter   ~0119555

I wanted to add that this fix actually creates a 24 bit bitmap so it's not really a fix but if anyone can see it in their heart to figure a way to make it stay 32 bit and work as a transparency I would be grateful.

Issue History

Date Modified Username Field Change
2019-11-30 03:43 jamie philbrook New Issue
2019-11-30 04:03 jamie philbrook Note Added: 0119555