Draw onto the transparent area of an image.

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
TGT
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Dec 15, 2005 8:09 pm

Draw onto the transparent area of an image.

Post by TGT »

Hi,

is it somehow possible to draw onto the transparent area of an image!?

Thanks, Tom
Izhaki
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Feb 24, 2006 7:06 pm

Post by Izhaki »

Yes, but you will need to change the alpha channel of the area onto which you are drawing. A transparent area will have its alpha channel set to 0 for all transparent pixels - no matter what values exist on the RGB channels these pixels will not be drawn.

Look at wxImage SetAlpha() and GetAlpha()

You can also try to draw into an off screen bitmap and them copy it onto the image.
TGT
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Dec 15, 2005 8:09 pm

Post by TGT »

Hmm - I wasn't able to test this

...quite strange situation:
error: 'class wxImage' has no member named 'GetAlpha'
Today this is the second time something like that happend to me :?
(Set/GetMinSize, Set/GetMaxSize)
Of course both are mentioned in the online documentation.... and no I'm not using wx < 2.5 (regarding the note in the docu)


Any ideas :shock: