Compile SVG into code

Source Generation

Turn artwork into generated drawing code before the application starts.

Explore source
Parent systemSvg.Skia
StatusStable
Modules2
RepositorySvg.Skia/Svg.SourceGenerator.Skia

Code generation packages transform SVG assets into strongly referenced Skia drawing code at build time, reducing runtime parsing and asset lookup.

  1. 01

    Build-time SVG processing

  2. 02

    Generated C# drawing code

  3. 03

    Strong asset identity

  4. 04

    No runtime XML parse for generated assets

From intent
to working system.

01

Discover

MSBuild AdditionalFiles identify SVG assets.

02

Convert

The code generator resolves SVG features into Skia operations.

03

Emit

The source generator adds typed C# to the compilation.

04

Draw

Application code invokes the generated picture path directly.

Adopt this
capability.

Start with the primary module, then add the related packages only when the application needs those layers. Replace VERSION with the current NuGet version.

01 · Install
Terminal
dotnet add package Svg.SourceGenerator.Skia
02 · Use · xml
MainWindow.axaml
<ItemGroup>
<AdditionalFiles Include="Assets/**/*.svg" />
</ItemGroup>

Use one layer.
Compose the rest.

Read the module beside the complete system.

The implementation, samples, issues, and release notes stay in the parent repository so module details remain connected to the product architecture.

Svg.Skia

Search everything.

Loading the index…

move open esc close

Preparing metadata and full-text search…