![]() | ![]() | ![]() | RSVG Reference Manual | ![]() |
---|
GQuark rsvg_error_quark (void); void (*RsvgSizeFunc) (gint *width, gint *height, gpointer user_data); void rsvg_set_default_dpi (double dpi); RsvgHandle* rsvg_handle_new (void); void rsvg_handle_set_dpi (RsvgHandle *handle, double dpi); void rsvg_handle_set_size_callback (RsvgHandle *handle, RsvgSizeFunc size_func, gpointer user_data, GDestroyNotify user_data_destroy); gboolean rsvg_handle_write (RsvgHandle *handle, const guchar *buf, gsize count, GError **error); gboolean rsvg_handle_close (RsvgHandle *handle, GError **error); GdkPixbuf* rsvg_handle_get_pixbuf (RsvgHandle *handle); G_CONST_RETURN char* rsvg_handle_get_title (RsvgHandle *handle); G_CONST_RETURN char* rsvg_handle_get_desc (RsvgHandle *handle); void rsvg_handle_free (RsvgHandle *handle);
GQuark rsvg_error_quark (void);
The error domain for RSVG
Returns : | The error domain |
void (*RsvgSizeFunc) (gint *width, gint *height, gpointer user_data);
Function to let a user of the library specify the SVG's dimensions width: the ouput width the SVG should be height: the output height the SVG should be user_data: user data
width : | Pointer to where to set/store the width |
height : | Pointer to where to set/store the height |
user_data : | User data pointer |
void rsvg_set_default_dpi (double dpi);
Sets the DPI for the all future outgoing pixbufs. Common values are
72, 90, and 300 DPI. Passing a number <= 0 to
dpi : | Dots Per Inch (aka Pixels Per Inch) |
Since 2.2
RsvgHandle* rsvg_handle_new (void);
Returns a new rsvg handle. Must be freed with rsvg_handle_free. This handle can be used for dynamically loading an image. You need to feed it data using rsvg_handle_write, then call rsvg_handle_close when done. No more than one image can be loaded with one handle.
Returns : | A new |
void rsvg_handle_set_dpi (RsvgHandle *handle, double dpi);
Sets the DPI for the outgoing pixbuf. Common values are
72, 90, and 300 DPI. Passing a number <= 0 to
handle : | An |
dpi : | Dots Per Inch (aka Pixels Per Inch) |
Since 2.2
void rsvg_handle_set_size_callback (RsvgHandle *handle, RsvgSizeFunc size_func, gpointer user_data, GDestroyNotify user_data_destroy);
Sets the sizing function for the handle. This function is called right after the size of the image has been loaded. The size of the image is passed in to the function, which may then modify these values to set the real size of the generated pixbuf. If the image has no associated size, then the size arguments are set to -1.
handle : | An |
size_func : | A sizing function, or NULL |
user_data : | User data to pass to size_func, or NULL |
user_data_destroy : | Destroy function for user_data, or NULL |
gboolean rsvg_handle_write (RsvgHandle *handle, const guchar *buf, gsize count, GError **error);
Loads the next count bytes of the image. This will return
handle : | An |
buf : | Pointer to svg data |
count : | length of the buf buffer in bytes |
error : | return location for errors |
Returns : | |
gboolean rsvg_handle_close (RsvgHandle *handle, GError **error);
Closes handle, to indicate that loading the image is complete. This will
return
handle : | A |
error : | A |
Returns : | |
GdkPixbuf* rsvg_handle_get_pixbuf (RsvgHandle *handle);
Returns the pixbuf loaded by
handle : | An |
Returns : | the pixbuf loaded by |
G_CONST_RETURN char* rsvg_handle_get_title (RsvgHandle *handle);
Returns the SVG's title in UTF-8 or NULL. You must make a copy
of this title if you wish to use it after
handle : | An |
Returns : | The SVG's title |
Since 2.4
G_CONST_RETURN char* rsvg_handle_get_desc (RsvgHandle *handle);
Returns the SVG's description in UTF-8 or NULL. You must make a copy
of this description if you wish to use it after
handle : | An |
Returns : | The SVG's description |
Since 2.4
<<< Using RSVG | Handling Gzipped SVGs (SVGZ) >>> |