RE: saving pixmap/pixbuf using gdk_imlib_save_image



Title: RE: saving pixmap/pixbuf using gdk_imlib_save_image

Hi Thomas. I would highly recommend downloading the source code for imlib and gdkpixbuf if you haven't done so already. Look at the io-XXX.c functions, where XXX is the image format filename extension, that imlib uses to figure out the format in which you want to load and save images. If it does not contain an io-XXX file for your image format, then the version I have invokes the "convert" executable of "ImageMagick" to save it for you.

For performance reasons, if there is no io-XXX.c for your format, I wouldn't use that format. I tend to use PNG images anyway for all my work right now, which are supported by imlib or at least modularized enough to invoke the libpng functions.

After looking the "gdk_imlib_save_image(GdkImlibImage *im, char *file, GdkImlibSaveInfo *info)" function is merely a modular wrapper around the io-XXX functions like saver_png, etc.. You could of course call saver_png directly which takes the same function signature, although of course you will lose some image independance (if you care about that). In this example, "im" deep down contains the pixel data, "file" is the name of the file you want to save as (making sure its something like XXXXXX.png), and "info" is not used at all.

Hope this helps you out since I am still a novice on manipulating images with GTK+,
Cheers,
    Tim.

-----Original Message-----
From: Thomas Amsler [mailto:tpamsler ucdavis edu]
Sent: Tuesday, October 10, 2000 1:35 AM
To: gtk-app-devel-list gnome org
Subject: saving pixmap/pixbuf using gdk_imlib_save_image


I am still trying to figure out on how to save either a pixmap or a
pixbuf using the imlib function bellow.

gint gdk_imlib_save_image(GdkImlibImage *im, char *file,
GdkImlibSaveInfo *info);

I don't know what these parameters are and how I can extract the data
from a pixmap or a pixbuf to use this functions. I looked through the
imlib documentation but that is no help.
Any help is appreciated.

PS:  I know that there is a patch for gdk-pixbuf out that adds saving
capabilities.  I wonder what ever happen to it and if it will ever be
added to the current gdk-pixbuf source?

Thank you very much.
--

Thomas Amsler

"Imagination is more important than knowledge."
        --Albert Einstein



_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]