What's wrong with Graphics32 TBitmap32.Assign()? Why is the transparency of the original image not preserved for TBitmap32, while for TBitmap everything is fine? Here is a sample code:
procedure TForm1.Button8Click(Sender: TObject);
var
bmp32: TBitmap32;
bmp: TBitmap;
wic: TWICImage;
begin
bmp32 := TBitmap32.Create(TMemoryBackend);
bmp := TBitmap.Create;
wic := TWICImage.Create;
try
wic.LoadFromFile('overlay.png'); // transparent
bmp32.Assign(wic);
bmp32.SaveToFile('BMP32.bmp'); // !!! nontransparent .bmp
img1.Bitmap.Assign(bmp32);
bmp.Assign(wic);
bmp.SaveToFile('BMP.bmp'); // transparent .bmp
img2.Bitmap.Assign(bmp);
finally
wic.Free;
bmp32.Free;
bmp.Free;
end;
end;
Here is a screenshot of the result:
Is this a Graphics32 library (version is the latest from github) bug? Or TWICImage bug? Or Delphi 10.2.3 bug? Or am I doing something wrong? How to fix this?