Michel Schmid wrote: > I want to show a image over another image (is this the correct way to > describe this? sorry, but my mothertongue ist not english.. :-) ) > In other words, I have a image and its backgroud is also a image... > > The picture in front is a battery (which shows the battery-state of an > embedded-system, so i need several pictures to show the various > battery-states). In background there ist a bar which goes smoothly from black > to grey... So it is a tedious to design those battery-pictures with a > background that fits to its image behind...
This should all be doable with less resources (e.g. memory for images) with a (rather simple (?)) draw method. If your background image is only a smooth color transient (as you wrote, from black to grey), then that's really easy. This can be done with a standard draw() method. Drawing a simple battery image with changing colors should be easy as well. For this problem I would really recommend to derive an own widget (probably from Fl_Box) and write your own draw method. Maybe you might want to look at Fl_Progress.cxx and/or its documentation. You can draw this battery image over the background, as you need. If you need alpha blending, well, then that's more difficult. Maybe you can use image data then ... If you still want or need to create image data on the fly, then you should also look at FLTK 1.3 in test/unittest_images.cxx [1]. There you can see a nice example for image data with color transients. Also, you can use a combination of all these methods: Make your own draw method that draws: (a) a background or background image (b) an empty battery image (this would probably need transparency) (c) the colored battery status info over the battery image. There are lots of possibilities ... Albrecht [1] <http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/test/unittest_images.cxx> _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

