Handle.renderCairoSub

Draws a subset of a loaded SVG handle to a Cairo context. Drawing will occur with respect to the @cr's current transformation: for example, if the @cr has a rotated current transformation matrix, the whole SVG will be rotated in the rendered version.

This function depends on the #RsvgHandle's DPI to compute dimensions in pixels, so you should call rsvg_handle_set_dpi() beforehand.

Note that @cr must be a Cairo context that is not in an error state, that is, cairo_status() must return #CAIRO_STATUS_SUCCESS for it. Cairo can set a context to be in an error state in various situations, for example, if it was passed an invalid matrix or if it was created for an invalid surface.

Element IDs should look like an URL fragment identifier; for example, pass "##foo" (hash <literal>foo</literal>) to get the geometry of the element that has an <literal>id="foo"</literal> attribute.

class Handle
bool
renderCairoSub
(,
string id
)

Parameters

cr Context

A Cairo context

id string

An element's id within the SVG, starting with "##" (a single hash character), for example, "##layer1". This notation corresponds to a URL's fragment ID. Alternatively, pass %NULL to render the whole SVG.

Return Value

Type: bool

%TRUE if drawing succeeded; %FALSE otherwise.

Meta

Since

2.14