> Thanx, I will look into the fl_offscreen; are there any
> examples/code snippets here on the site?

        I just grepped the fltk 1.3.x 'FL' directory; looks like
        the functions are:

                fl_create_offscreen(w,h)
                fl_begin_offscreen(pixmap)
                fl_end_offscreen()
                fl_copy_offscreen(x,y,w,h,pixmap,srcx,srcy)
                fl_delete_offscreen(pixmap)

        I don't think they have docs yet.

        My guess is you bracket your regular fltk drawing code
        with fl_begin_offscreen() and fl_end_offscreen(), and the
        pixels will go into ram instead of a window.

        Then I suppose it's a matter of writing the captured
        image out to a file using either libpng or ImageMagick.
        (The latter supports *many* image formats, and is a great lib
        that compiles across linux/win/mac)

> 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)

        ImageMagick is one of the best ways to go IMHO,
        supports all the major image formats, and lets you draw
        lines, text in different fonts, etc.

        So you could either use it in a simple way to export
        the offscreen stuff above to a file, or you could wrapperize
        all your drawing functions so that they either use FLTK
        or ImageMagick's drawing functions.

        I suppose at worst, you could have your File -> Export
        function pop a temporary Fl_Window that draws each part
        of the graph, using fl_read_pixels() to grab the parts
        and stitch them into a giant buffer that you then write
        out as an image.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to