Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: JasonLugg on April 28, 2017, 08:22:53 pm

Title: [SOLVED] Image Transparency
Post by: JasonLugg on April 28, 2017, 08:22:53 pm
Hi All,

Not been here for ages but really could do with some help please.

I have a TImage on a form which the user draws to (like a pixel paint program). Currently the 'background' of the TImage.Canvas is clBlack.

I wish to save this image with the clBlack (or any other colour) being transparent so that when it is loaded into another app such as paint.net, the 'background' is transparent.

I have tried saving it as a png and just get a totally transparent png (no pixels shown)?

Any help to 'turn' an existing TImage.Canvas into a transparent png would be very much appreciated.

Thanks in advance.
 :D
Title: Re: Image Transparency
Post by: RAW on April 28, 2017, 09:33:07 pm
You can use

BGRABitmap
or
Graphics32
or
VampyreImagingLib
or
fpGUI (AGG PAS)

to create semitransparent pics or draw semitransparent pixels...

I don't think Lazarus can do this out of the box, but I never really tried this...
Title: Re: Image Transparency
Post by: Handoko on April 28, 2017, 09:34:55 pm
@JasonLugg:

I found these discussions may be useful to you:

http://forum.lazarus.freepascal.org/index.php/topic,13163.msg214640.html

http://forum.lazarus.freepascal.org/index.php/topic,2939.msg13502.html

http://forum.lazarus.freepascal.org/index.php/topic,8937.msg43394.html
Title: Re: Image Transparency
Post by: JasonLugg on April 29, 2017, 10:49:47 am
Guys

Many many thanks. That is VERY helpful!

Problem solved.
TinyPortal © 2005-2018