Hi AsleyCruz
Since I know the BGRA library I dont have to fool around with transparency of bitmap or png which causes often trouble.
Transparency is so easy to handle with BGRA and you dont have to care about 16/24 or 32 bit
One trick in my example is the use of the "magicWhite" .
It contains the RGB values for white 255/255/255.
But it has an alpha value of zero, so it is complete transparent.
And this value can be changed very simple so the transparent pixels turn tp white.
procedure TForm1.SpeedButton1Click(Sender: TObject);
var tmp: TBGRAbitmap;
magicWhite : TBGRAPixel;
begin
Image1.Canvas.Brush.color := clYellow;
Image1.Canvas.FillRect(0,0,Image1.Width, Image1.Height);
MagicWhite :=BGRA(255,255,255,0);
tmp := TBGRAbitmap.Create (Image1.width,Image1.Height, MagicWhite);
Tmp.FillEllipseAntialias(100,100,30,30,cssRed);
tmp.Draw(Image1.Canvas,0,0,false);
image1.Refresh;
ShowMessage ('That was transparent'+LineEnding+'Now opaque');
tmp.AlphaFill(255,0,tmp.NbPixels);
tmp.Draw(Image1.Canvas,0,0,false);
image1.Refresh;
tmp.SaveToFile('Something.png');
tmp.free;
end;
Winni