LIBRSVG: C library for rendering SVG

LIBRSVG 2.62.3 C library for rendering SVG

Loading...
Searching...
No Matches
Functions
Pixbuf
librsvg

Render to a GdkPixbuf. More...

## Functions
GdkPixbuf * | rsvg_handle_get_pixbuf (RsvgHandle *handle)
| rsvg_handle_get_pixbuf: @handle: an #RsvgHandle
GdkPixbuf * | rsvg_handle_get_pixbuf_and_error (RsvgHandle *handle, GError **error)
| Render the SVG to a #GdkPixbuf.
GdkPixbuf * | rsvg_handle_get_pixbuf_sub (RsvgHandle *handle, const char *id)
| rsvg_handle_get_pixbuf_sub: @handle: an #RsvgHandle @id: (nullable): element id starting with `#`, or NULL for the whole SVG
GdkPixbuf * | rsvg_pixbuf_from_file (const gchar *filename, GError **error)
| rsvg_pixbuf_from_file: @filename: a file name @error: return location for a #GError
GdkPixbuf * | rsvg_pixbuf_from_file_at_zoom (const gchar *filename, double x_zoom, double y_zoom, GError **error)
| rsvg_pixbuf_from_file_at_zoom:
GdkPixbuf * | rsvg_pixbuf_from_file_at_size (const gchar *filename, gint width, gint height, GError **error)
| rsvg_pixbuf_from_file_at_size:
GdkPixbuf * | rsvg_pixbuf_from_file_at_max_size (const gchar *filename, gint max_width, gint max_height, GError **error)
| rsvg_pixbuf_from_file_at_max_size:
GdkPixbuf * | rsvg_pixbuf_from_file_at_zoom_with_max (const gchar *filename, double x_zoom, double y_zoom, gint max_width, gint max_height, GError **error)
| rsvg_pixbuf_from_file_at_zoom_with_max:

## Detailed Description

Render to a GdkPixbuf.

Prefer rsvg_handle_get_pixbuf_and_error(). rsvg_handle_get_pixbuf() is deprecated.

## Function Documentation

## ◆ rsvg_handle_get_pixbuf()

GdkPixbuf * rsvg_handle_get_pixbuf | ( | RsvgHandle * | handle | ) |

`#include <rsvg-pixbuf.h>`

rsvg_handle_get_pixbuf: @handle: an #RsvgHandle

Render the SVG to a #GdkPixbuf. On failure this returns NULL without a #GError.

Deprecated:
  Since 2.58: use rsvg_handle_get_pixbuf_and_error() instead.

Since
  2.0

## ◆ rsvg_handle_get_pixbuf_and_error()

GdkPixbuf * rsvg_handle_get_pixbuf_and_error | ( | RsvgHandle * | handle,
|  | GError ** | error
| ) |  |

`#include <rsvg-pixbuf.h>`

Render the SVG to a #GdkPixbuf.

@handle: an #RsvgHandle @error: return location for a #GError

Size uses the handle DPI and the document’s intrinsic dimensions.

Returns: (transfer full) (nullable): a new pixbuf, or NULL on error.

Since
  2.58

## ◆ rsvg_handle_get_pixbuf_sub()

GdkPixbuf * rsvg_handle_get_pixbuf_sub | ( | RsvgHandle * | handle,
|  | const char * | id
| ) |  |

`#include <rsvg-pixbuf.h>`

rsvg_handle_get_pixbuf_sub: @handle: an #RsvgHandle @id: (nullable): element id starting with `#`, or NULL for the whole SVG

Render one element into a pixbuf the size of the whole SVG.

Returns: (transfer full) (nullable): a new pixbuf, or NULL on error.

Since
  2.14

## ◆ rsvg_pixbuf_from_file()

GdkPixbuf * rsvg_pixbuf_from_file | ( | const gchar * | filename,
|  | GError ** | error
| ) |  |

`#include <rsvg-pixbuf.h>`

rsvg_pixbuf_from_file: @filename: a file name @error: return location for a #GError

Load @filename and return a pixbuf.

Deprecated:
  Use rsvg_handle_new_from_file() and rsvg_handle_render_document().

Since
  2.0

## ◆ rsvg_pixbuf_from_file_at_max_size()

GdkPixbuf * rsvg_pixbuf_from_file_at_max_size | ( | const gchar * | filename,
|  | gint | max_width,
|  | gint | max_height,
|  | GError ** | error
| ) |  |

`#include <rsvg-pixbuf.h>`

rsvg_pixbuf_from_file_at_max_size:

Deprecated:
  Use rsvg_handle_new_from_file() and rsvg_handle_render_document().

Since
  2.0

## ◆ rsvg_pixbuf_from_file_at_size()

GdkPixbuf * rsvg_pixbuf_from_file_at_size | ( | const gchar * | filename,
|  | gint | width,
|  | gint | height,
|  | GError ** | error
| ) |  |

`#include <rsvg-pixbuf.h>`

rsvg_pixbuf_from_file_at_size:

Deprecated:
  Use rsvg_handle_new_from_file() and rsvg_handle_render_document().

Since
  2.0

## ◆ rsvg_pixbuf_from_file_at_zoom()

GdkPixbuf * rsvg_pixbuf_from_file_at_zoom | ( | const gchar * | filename,
|  | double | x_zoom,
|  | double | y_zoom,
|  | GError ** | error
| ) |  |

`#include <rsvg-pixbuf.h>`

rsvg_pixbuf_from_file_at_zoom:

Deprecated:
  Use rsvg_handle_new_from_file() and rsvg_handle_render_document().

Since
  2.0

## ◆ rsvg_pixbuf_from_file_at_zoom_with_max()

GdkPixbuf * rsvg_pixbuf_from_file_at_zoom_with_max | ( | const gchar * | filename,
|  | double | x_zoom,
|  | double | y_zoom,
|  | gint | max_width,
|  | gint | max_height,
|  | GError ** | error
| ) |  |

`#include <rsvg-pixbuf.h>`

rsvg_pixbuf_from_file_at_zoom_with_max:

Deprecated:
  Use rsvg_handle_new_from_file() and rsvg_handle_render_document().

Since
  2.0