[Lazarus] How to create a transparent PNG?

Gabor Boros gaborboros at yahoo.com
Wed Mar 16 20:25:45 CET 2016


Hi All,

I want to draw onto a PNG image and save it without background. Tried 
Transparent, TransparentColor, TransparentMode properties without 
success. I need the A character in the PNG with black color without 
background. Any idea?

procedure PNG;
var
   P:TPortableNetworkGraphic;
begin
   P:=TPortableNetworkGraphic.Create;
   P.SetSize(20,20);
   P.Canvas.TextOut(0,0,'A');
   P.SaveToFile('TEST.PNG');
   P.Free;
end;

Gabor




More information about the Lazarus mailing list