File saving

Name

File saving -- Saving a pixbuf to a file.

Synopsis


#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,
                                             ...);

Description

Details

gdk_pixbuf_savev ()

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.


gdk_pixbuf_save ()

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.

The variable argument list should be NULL-terminated; if not empty, it should contain pairs of strings that modify the save parameters. For example:

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. Note however that PNG text chunks are stored in ISO-8859-1 encoding, so you can only set texts that can be represented in this encoding.