public class SvgImage extends Image:
Scalable Vector Graphics image.
SvgImage represents a SVG document loaded from disk. It keeps the vector source and lets the native window backend render it at any destination size. The logical image area is a viewBox: resize(...) changes its size and crop(...) changes its origin and size. Icons should generally use currentColor so they can be tinted by the active theme.
icon = SvgImage("assets/icons/save.svg")
icon.render(painter, 12, 12, 24, 24, Color.parse("#9AA3B2"), false, Color.white())| Modifier and Type | Member | Description |
|---|---|---|
| public override readonly property | heightheight as Int: |
Logical SVG viewBox height when set. |
| public override readonly property | widthwidth as Int: |
Logical SVG viewBox width when set. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | SvgImage | Creates a SVG image descriptor. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | crop | Crops the logical SVG viewBox. |
| public override | loadload(fileName as String) as Void: |
Loads another SVG file into this image descriptor. |
| public | render | Renders the SVG into the given painter. |
| public override | resize | Resizes the logical SVG viewBox. |