Skia.Controls.Avalonia is the general-purpose Avalonia package for displaying or drawing raw SkiaSharp content. It complements the SVG-specific packages, but it is useful even when SVG is not involved at all.
dotnet add package Skia.Controls.Avalonia
SKCanvas, SKBitmap, SKPath, or SKPicture content,| Type | Role |
|---|---|
SKCanvasControl |
Draw event for custom SkiaSharp painting |
SKBitmapControl |
Displays an SKBitmap |
SKPathControl |
Displays an SKPath with an optional SKPaint |
SKPictureControl |
Displays an SKPicture |
SKBitmapImage |
IImage wrapper around SKBitmap |
SKPathImage |
IImage wrapper around SKPath |
SKPictureImage |
IImage wrapper around SKPicture |
SKCanvasControlUse this when you want direct draw-event access:
CanvasControl.Draw += (_, e) =>
{
using var paint = new SkiaSharp.SKPaint
{
Color = SkiaSharp.SKColors.Aqua,
IsAntialias = true
};
e.Canvas.DrawCircle(80, 80, 48, paint);
};
SKPictureControlThis is the natural bridge from Svg.Skia or generated pictures into Avalonia:
<SKPictureControl Picture="{x:Static local:Tiger.Picture}"
Stretch="Uniform" />
It is especially useful with:
SKSvg.Picture from Svg.Skia,Picture classes from Svg.SourceGenerator.Skia,SKPictureImageWhen an Avalonia Image needs to display a picture instead of a control hosting it:
<Image>
<Image.Source>
<SKPictureImage Source="{x:Static local:Camera.Picture}" />
</Image.Source>
</Image>
That keeps the asset reusable across templates, lists, buttons, and resource dictionaries.
Skia.Controls.Avalonia is the shared presentation layer for non-SVG-specific Skia content. It is the package that keeps SVG-generated pictures compatible with the rest of an application's Skia assets.
Svg, SvgImage, SvgSource, or SvgResource.