Re: XForms: flimage problem [followup]

From: spl@ncmir.ucsd.edu
Date: Wed Mar 06 2002 - 17:06:36 EST


# To subscribers of the xforms list from spl@ncmir.ucsd.edu :

> I am trying to dump a pixmap to a file. I found the flimage stuff and
> it looks (more or less) exactly like what I need. ...
>
> int dump_pixmap( Pixmap p, int w, int h )
> {
> FL_IMAGE *im;
> char name[ ] = "A.gif";
>
> if ( ( im = flimage_alloc( ) ) == NULL )
> return 0;
>
> im->type = FL_IMAGE_RGB;
> im->w = w;
> im->h = w;
> flimage_getmem( im );
>
> flimage_from_pixmap( im, p );
> flimage_dump( im, name, "GIF" );
> flimage_free( im );
>
> return 1;
> }

Actually, I should back up and say that part of the above is
redundant. All you need to do is

    if ( ( im = flimage_alloc( ) ) == NULL )
        return 0;

    flimage_from_pixmap( im, pixmap );
    flimage_dump( im, name, "GIF" );
    flimage_free( im );

                                                                spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/



This archive was generated by hypermail 2b29 : Wed May 01 2002 - 13:54:15 EDT