Image::setPixelData and Alpha Channel!


#1

Hi Jucers

I am experiencing trouble with the Image::setPixelData function:

  • I have a Graphics obj initialized with an Image to draw on. The Image is initialized with transparentwhite Colour so only the regions where I draw on, are really written.
  • Drawing the Image on Screen is completely - the transparent pixels are also shown transparent
  • Problem: when I try to “mix” the pixels of the upper Image with another Image by setting

the result is filled with white colour whereit should be transparent so i don’t see the second image at all.

Is there some trick?

Thx a lot!

Nina


#2

No, there’s no trick, but if you’re going to directly write to the raw pixel data, then it’s up to you to get your graphics operations right! Why not just use the Graphics class to overlay an image?


#3