If you use Fl_Image_Surface to prepare the shape of your window, you'll obtain a depth 3 a.k.a. RGB image with member function Fl_Image_Surface::image(). Thus the rule you have to follow is :
With an Fl_RGB_Image of depth 1 (gray-scale) or 3 (RGB), the shaped window covers the non-black image part. In other words, every non black pixel in the resulting image is inside the shape, every black pixel is outside the shape. Consider, please, examples/shapedwindow.cxx which obeys this rule.
If you use something producing an image with transparency, e.g., pixmap or PNG, to control the shape of the window, then you have to consider that rule: With an Fl_RGB_Image with an alpha channel (depths 2 or 4), the shaped window covers the image part that is not fully transparent. There, the fully transparent area of the image is outside the window shape, and everything else is inside.
FLTK uses an RGB color model when drawing (except when drawing depth-4 or depth-2 images). That's why the result of Fl_Image_Surface::image() is an RGB, not an RGBA, image.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/3f097b46-580f-48b4-ad08-184c5c51428en%40googlegroups.com.
[ Direct Link to Message ] |