[Solved] ImageGadget Background

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

[Solved] ImageGadget Background

Post by IdeasVacuum »

Working very late :shock:

I thought that ImageGadgets respected the transparency of 32bit images, but apparently not - I was expecting to see the underlying background (Canvas).

So, is there a flag to make this happen? I can fake it by drawing the image onto another that is first filled with the background colour, but in the app I'm currently building, the User could change the background colour after the image is set in the ImageGadget...........

Edit: Conundrum! In my app, the code defines the image, then either saves a 32bit PNG file or saves to the clipboard. If the PNG is drag & dropped into an image gadget (in a separate app), the transparency is not respected. If the image is pasted into an image gadget from the clipboard, transparency is perfect. :shock: So, sounds like it is me.......

Edit: Solution was to explicitly save a 32bit image with transparency - by default, it is actually saved as 24bit with transparency, which worked in all my apps (arrived correctly) except those written in PB. So, my bad!

Code: Select all

SaveImage(#IMAGE_Out,sgImageOutFile,#PB_ImagePlugin_PNG,32)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.