32 bit bitmaps will not draw transparently due to incomplete code.
Original Reporter info from Mantis: jamie @jamie
-
Reporter name: jamie philbrook
Original Reporter info from Mantis: jamie @jamie
- Reporter name: jamie philbrook
Description:
I 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 #225 (closed) 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 reproduce:
procedure 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.
Mantis conversion info:
- Mantis ID: 36383
- Version: 2.0.6
- Monitored by: » ps (Pavol S)