Hi, > > very large graphs. In the application the graphs are > > scrollable, in this way you can see any details, but now I > > need to have the whole graph as an image in order to > > save/export; a screen capture does not work as it only > > captures the actual scroll pane. > > I tried to look at Fl_Image* Fl_Widget::image() but it > > doesn't work: the graph is made of Fl_Widgets and not > > directly of a large Fl_Image. > > > The question is: is there any way to 'grab' the visualization > > of a Fl_Scroll (or a Fl_Group)? I would expect an image at > > some level in the fltk class hierarchy holding the image > > which is actually rendered, I'm wondering how to copy such an image. > > Why should such an image exist? Most rendering systems will make use of > the clipping regions that are current when they are drawing, and only > draw the bits that can be seen. > So in general, the whole image need not (and usually does not) exist > anywhere.
I see. Actually I was already afraid of such an graphical optimalization > > Alternatively any suggestion about how to 'capture' the whole > > Fl_Scroll content is welcome as well! > > I think I would render the entire scene into an fl_offscreen, then view > that offscreen buffer through the scroll. > Then when I wanted to get the image, I could read it back from the > offscreen. > This has a number of other advantages too, but also has some > disadvantages... Not least that it is more complex to set up, and may > conceivably be slower, too. > > Actually, when I did something like this, I didn't even bother with the > Fl_Scroll at all - instead I used a pair of Fl_Scrollbar widgets to > "simulate" a scroll region and simply selected the appropriate rectangle > from the offscreen to blit onto the viewer widget (which was derived > from Fl_Box). > > A later iteration added a crude "zoom" function that used the blit from > the offscreen to also sub-sample the view, allowing me to "zoom out" and > see the entire scene. Was a bit grainy, but worked OK. > > Ian Well, I'm wondering just now how to grab an overall view of my graphs, as I am a fltk/fluid beginner, until now I just focused on getting the visualization done. Now my thesis project is finishing and I realize I need an overall visualization of my graphs... My purpose is to save such a graph to a gif/png (I'm realizing that fltk has tools just to read image files, but not to write them, so I need to look for a third party free library I guess) so speed is not a big issue while resolution could be: I'd like to preserve the details, therefore I think I shouldn't zoom out. If my panel has size h by w, I think a bitmap of the same h by w would be fine. Thanx, I will look into the fl_offscreen; are there any examples/code snippets here on the site? Sincerely, /Fabio > SELEX Sensors and Airborne Systems Limited > Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex= > SS14 3EL > A company registered in England & Wales. Company no. 02426132 > ******************************************************************** > This email and any attachments are confidential to the intended > recipient and may also be privileged. If you are not the intended > recipient please delete it from your system and notify the sender. > You should not copy it or use it for any purpose nor disclose or > distribute its contents to any other person. > ******************************************************************** > _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

