GdkPixbuf.Pixbuf.save_to_buffer

### 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.

#### 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
| Ownership of the data is transferred to the callee
`buffer_size` | `gsize*`
| location to receive the size of the new buffer.
| Direction: out
| Ownership of the data is transferred to the callee
`type` | `const char*`
| name of file format.
| Ownership is not transferred to the callee
| The string is a NUL terminated UTF-8 string
`error` | `GError**`
| return location for error, or `NULL`
| Can be `NULL`
| Ownership is not transferred to the callee
`...` | ``
| list of key-value save options

#### Return value

Returns: `gboolean`
whether an error was set