SVG Control Library¶
The SVG Control Library gives your Delphi or FPC/Lazarus application the tools to work with SVG drawings. As in a web browser, a drawing is loaded into a Document Object Model that your code can query and change: find elements, bind them to live data, and let users interact with them. The result is rendered to screen, bitmap, printer, PDF or EMF.
The drawings are made in Inkscape, Illustrator, Visio or a CAD program and stay separate files. Designers can change a drawing without a developer, and your application doesn't need to be rebuilt.
What you can do with it¶
-
Load and change drawings
Parse SVG into a document tree, find elements by id, tag, class or attribute, and change attributes, styles and structure at run time. See Changing drawings.
-
Bind drawings to data
Let a colour follow a status or a text follow a measurement, declared once instead of coded per element. See Data binding.
-
Make drawings interactive
Hit testing and mouse events on individual elements, zoom and pan, and SVG and CSS animation. See Interactive drawings.
-
Get the result out
Components for VCL, FMX and Lazarus forms, bitmaps from code, printing at real size, PDF, and vector EMF for Office and report tools. See Output.
It supports Delphi XE2 to Delphi 13 (VCL and FireMonkey) and FPC/Lazarus, and renders through Direct2D, GDI+, Skia, Quartz, the FMX canvas, Graphics32, AggPas, or BGRABitmap (not tested with the current version). See How rendering works.
Start here¶
-
How to use the library in a product, from installation to output. Start with Getting started.
-
Every component, interface and member, generated from the source.
| If you want to… | Go to |
|---|---|
| Install the library in Delphi | Install in Delphi |
| Install the library in Lazarus | Install in FPC/Lazarus |
| See a drawing on a form and in code | Your first drawing |
| Check whether your drawings will render | What is supported |
| Upgrade from an earlier version | Upgrading |
| Look up a type or member | API reference |
To try the library first, download the free demo packages and viewers.
New in version 2.4 update 25¶
| What | Where |
|---|---|
| Render one pass on another backend, for example EMF through GDI+ while the screen uses Direct2D | Choosing a backend |
| EMF export from any application, in one call | EMF for Office and report tools |
| Printing at real size, PDF without a dialog, drawing into a report band or grid cell | Printing, PDF, Drawing into your own canvas |
| Data binding in the core package, on VCL, FMX and Lazarus | Data binding |
| Finding elements by tag, class or attribute | Finding elements |
| Zoom and pan on every control, and zoom to an element | Zoom and pan |
| Hit testing that agrees with clicks, as in browsers | Hit testing |
| Skia as a full render context, with PDF output and FMX on macOS | Choosing a backend |
mix-blend-mode, paint-order, CSS variables, !important, non-scaling strokes, baselines |
SVG and CSS coverage |
Update 25 has breaking changes for code that implements render contexts or
uses ObjectAtPt; see Upgrading. The full list
of changes is in the
change log and in
Doc\Changelog.txt in the package.
About this documentation¶
This site documents version 2.4 update 25. It replaces the manual
Delphi SVG control version 2_4.html, last revised in January 2022. The
Guide explains how to use the library; the API reference is generated
from the source code and lists every type and member, though many members do
not yet carry a description (see the reference overview).