|
|
Donner
C++20 SVG rendering library
|
Embeds an image into the SVG document.
Embeds an image into the SVG document.
If width or height are omitted, the sizes will be inferred using the image's intrinsic size, using the CSS default sizing algorithm, https://www.w3.org/TR/css-images-3/#default-sizing.
To reference an external image, provide its name or URL. Note that Donner must have a valid ResourceLoader provided to parser::SVGParser::ParseSVG, such as SandboxedFileResourceLoader.
To reference an embedded image using a data URL:
| Attribute | Default | Description |
|---|---|---|
| href | (none) | URL or base64 data URL of the image. |
| preserveAspectRatio | xMidYMid meet | How to scale the image to fit the rectangle defined by width and height if the image's intrinsic size is different. |
| x | 0 | X coordinate of the image. |
| y | 0 | Y coordinate of the image. |
| width | auto | Width of the image. If omitted, this value will be inferred from the height attribute (if provided), or it will fall back to the image's intrinsic size. |
| height | auto | Height of the image. If omitted, this value will be inferred from the width attribute (if provided), or it will fall back to the image's intrinsic size. |