On 13.02.2012 22:17, Prabu wrote: > I have images A and B. Image A is 3 channel and Image B is 4 channel. I am > trying to display image A and then overlay image B on top of A in Fl_Window. > Can someone please provide me with sample code that shows how to do this or > point me in the right direction?
FLTK 1.3 (or 1.1) has (have) test/unittest_images.cxx as an example how it can be done. Note that the "first image" is drawn by using fl_rectf(), but this could also be fl_draw_image() as well. The second image is drawn with Fl_RGB_Image::draw() or fl_draw_image(), as you can see in the example code. There are different ways to do it (and I just saw that Ian posted a similar reply already). Another easy way to draw an image is to use it as the label of an Fl_Box widget (see Fl_Widget::image()), and then to overlay two such boxes (with a frame type background), but I'm not sure if this will honor the alpha channel. Also, this might probably fail if only parts of the window get updated (FLTK doesn't officially support overlaying widgets, but it will mostly do what you think it should). Albrecht _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

