| The gdk-pixbuf Library |
|---|
File saving — Saving a pixbuf to a file.
#include <gdk-pixbuf/gdk-pixbuf.h> gboolean gdk_pixbuf_savev (GdkPixbuf *pixbuf, const char *filename, const char *type, char **option_keys, char **option_values, GError **error); gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf, const char *filename, const char *type, GError **error, ...);
gboolean gdk_pixbuf_savev (GdkPixbuf *pixbuf, const char *filename, const char *type, char **option_keys, char **option_values, GError **error);
Saves pixbuf to a file in type, which is currently "jpeg" or "png". If error is set, FALSE will be returned. See gdk_pixbuf_save() for more details.
| pixbuf : | a GdkPixbuf. |
| filename : | name of file to save. |
| type : | name of file format. |
| option_keys : | name of options to set, NULL-terminated |
| option_values : | values for named options |
| error : | return location for error, or NULL |
| Returns : | whether an error was set |
gboolean gdk_pixbuf_save (GdkPixbuf *pixbuf, const char *filename, const char *type, GError **error, ...);
Saves pixbuf to a file in type, which is currently "jpeg" or "png". If error is set, FALSE will be returned. Possible errors include those in the GDK_PIXBUF_ERROR domain and those in the G_FILE_ERROR domain.
gdk_pixbuf_save (pixbuf, handle, "jpeg", &error,
"quality", "100", NULL);
Currently only few parameters exist. JPEG images can be saved with a "quality" parameter; its value should be in the range [0,100]. Text chunks can be attached to PNG images by specifying parameters of the form "tEXt::key", where key is an ASCII string of length 1-79. The values are UTF-8 encoded strings.
| pixbuf : | a GdkPixbuf. |
| filename : | name of file to save. |
| type : | name of file format. |
| error : | return location for error, or NULL |
| ... : | list of key-value save options |
| Returns : | whether an error was set |
| << File Loading | Image Data in Memory >> |