Recent

Author Topic: [SOLVED] Image Transparency  (Read 7378 times)

JasonLugg

  • Jr. Member
  • **
  • Posts: 67
[SOLVED] Image Transparency
« 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
« Last Edit: April 29, 2017, 10:50:19 am by JasonLugg »

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: Image Transparency
« Reply #1 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...
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus

JasonLugg

  • Jr. Member
  • **
  • Posts: 67
Re: Image Transparency
« Reply #3 on: April 29, 2017, 10:49:47 am »
Guys

Many many thanks. That is VERY helpful!

Problem solved.

 

TinyPortal © 2005-2018