render_layer


Description:

[ Version ( since = "2.46" ) ]
public bool render_layer (Context cr, string? id, Rectangle viewport) throws Error

Renders a single SVG element in the same place as for a whole SVG document.

The viewport gives the position and size at which the whole SVG document would be rendered. The document is scaled proportionally to fit into this viewport; hence the individual layer may be smaller than this.

This is equivalent to [[email protected]_document], but it renders only a single element and its children, as if they composed an individual layer in the SVG. The element is rendered with the same transformation matrix as it has within the whole SVG document. Applications can use this to re-render a single element and repaint it on top of a previously-rendered document, for example.

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

You can pass `NULL` for the id if you want to render all the elements in the SVG, i.e. to render everything from the root element.

Parameters:

this

An [[email protected]]

cr

A Cairo context

id

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 document tree.

viewport

Viewport size at which the whole SVG would be fitted.

Returns:

`TRUE` on success, `FALSE` on error. Errors are returned in the throws argument.

API ordering: This function must be called on a fully-loaded this. See the section "[API ordering ](class.Handle.html#api-ordering)" for details.

Panics: this function will panic if the this is not fully-loaded.




2022 vala-language.org