Recent

Author Topic: Saving a TImage with a transparent background  (Read 431 times)

EganSolo

  • Sr. Member
  • ****
  • Posts: 297
Saving a TImage with a transparent background
« on: March 25, 2025, 03:05:03 am »
This should be easy... call me dumb ...
I've got a TImage control with transparent set to true.
Calling Picture.SaveTofile('test.png') saves the image with a white background.

What am I missing?

aoiraven90

  • Newbie
  • Posts: 3
Re: Saving a TImage with a transparent background
« Reply #1 on: April 09, 2025, 08:38:37 am »
Transparent property of TImage: TImage.Transparent := True applies that the image is visible when shared, but not when saved.

Try using BGRA Bitmap.

Dzandaa

  • Sr. Member
  • ****
  • Posts: 419
  • From C# to Lazarus
Re: Saving a TImage with a transparent background
« Reply #2 on: April 09, 2025, 11:47:11 am »
Hi,

Yes it works with a TBGRABitmap.

B->
Regards,
Dzandaa

 

TinyPortal © 2005-2018