Recent

Author Topic: [SOLVED] Image Transparency  (Read 4873 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: 867
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) And Windows XP Pro (x86 Sp3) - LAZARUS 2.0.8 FPC 3.0.4 - TRUNK 2.1.0 FPC 3.3.1
// This is polarity (hell) and hell is reigned by lies, nothing but lies. Be careful what you believe ...
// There are 10 types of people in this world, those who understand mind control and ...

Handoko

  • Hero Member
  • *****
  • Posts: 3902
  • 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