[Lazarus] How to create a transparent PNG?

Vojtěch Čihák vojtech.cihak at atlas.cz
Wed Mar 16 21:16:29 CET 2016


Hi,
 
there also must be
 
P.Canvas.Brush.Style:=bsClear;
 
before drawing text.
 
V.
______________________________________________________________
> Od: Gabor Boros <gaborboros at yahoo.com>
> Komu: <lazarus at lists.lazarus.freepascal.org>
> Datum: 16.03.2016 20:27
> Předmět: [Lazarus] How to create a transparent PNG?
>
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

--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160316/d1193dc9/attachment-0003.html>


More information about the Lazarus mailing list