Method

GdkPixbuf.Pixbuf.save_to_buffer

Declaration [src]

gboolean
gdk_pixbuf_save_to_buffer (
  GdkPixbuf* pixbuf,
  gchar** buffer,
  gsize* buffer_size,
  const char* type,
  GError** error,
  ...
)

Description [src]

Saves pixbuf to a new buffer in format type, which is currently “jpeg”, “png”, “tiff”, “ico” or “bmp”.

This is a convenience function that uses gdk_pixbuf_save_to_callback() to do the real work.

Note that the buffer is not NUL-terminated and may contain embedded NUL characters.

If error is set, FALSE will be returned and buffer will be set to NULL. Possible errors include those in the GDK_PIXBUF_ERROR domain.

See gdk_pixbuf_save() for more details.

Available since:2.4

Parameters

buffer An array of guint8
 

location to receive a pointer to the new buffer.

 Direction: out
 The length of the array is in the buffer_size argument
 The called function takes ownership of the data, and is responsible for freeing it
buffer_size gsize*
 

location to receive the size of the new buffer.

 Direction: out
 The called function takes ownership of the data, and is responsible for freeing it
type const char*
 

name of file format.

 The data is owned by the caller of the function
 The string is a NUL terminated UTF-8 string
error GError**
 

return location for error, or NULL

 Can be NULL
 The data is owned by the caller of the function
...
 

list of key-value save options

Return value

Returns: gboolean

whether an error was set