SkiaSharp.Views.Maui.Controls 4.153.0-preview.1.26454.6
SkiaSharp.Views.Maui.Controls
SkiaSharp.Views.Maui.Controls adds SkiaSharp rendering controls and image sources to .NET MAUI applications. Put a CPU- or GPU-backed canvas alongside standard MAUI controls, draw with the full SkiaSharp API, and share the same rendering code across Android, iOS, Mac Catalyst, and Windows.
What you get
SKCanvasViewfor CPU-rendered, on-demand drawing.SKGLViewfor hardware-accelerated drawing and continuous render loops.SKImageImageSource,SKBitmapImageSource,SKPixmapImageSource, andSKPictureImageSourcefor MAUI images.- XAML support, data binding, touch input, invalidation, and density-aware canvas sizing.
- Native handlers for Android, iOS, Mac Catalyst, and Windows.
Get started
Install the package:
dotnet add package SkiaSharp.Views.Maui.Controls
Register SkiaSharp in MauiProgram.cs:
using SkiaSharp.Views.Maui.Controls.Hosting;
public static MauiApp CreateMauiApp() =>
MauiApp
.CreateBuilder()
.UseMauiApp<App>()
.UseSkiaSharp()
.Build();
Add a canvas to a XAML page:
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:skia="clr-namespace:SkiaSharp.Views.Maui.Controls;assembly=SkiaSharp.Views.Maui.Controls">
<skia:SKCanvasView PaintSurface="OnPaintSurface" />
</ContentPage>
Draw in the PaintSurface handler:
using SkiaSharp;
using SkiaSharp.Views.Maui;
private void OnPaintSurface(object sender, SKPaintSurfaceEventArgs e)
{
var canvas = e.Surface.Canvas;
canvas.Clear(SKColors.White);
using var paint = new SKPaint
{
Color = SKColors.CornflowerBlue,
IsAntialias = true,
};
canvas.DrawCircle(e.Info.Width / 2f, e.Info.Height / 2f, 120, paint);
}
Call InvalidateSurface() whenever state changes and the view should redraw. Use SKGLView when the scene benefits from GPU rendering or a continuous animation loop.
Documentation and resources
- SkiaSharp .NET MAUI guides
- API reference on Microsoft Learn
- Buildable .NET MAUI sample
- Live SkiaSharp Gallery - explore the rendering API in your browser
- SkiaSharp package and deployment guide
Feedback and contributing
SkiaSharp is an open-source Microsoft project built with the .NET community. Use GitHub Discussions for questions, file bugs and feature requests in the issue tracker, and read the contributing guide to get involved.
This package is released under the MIT license.
No packages depend on SkiaSharp.Views.Maui.Controls.
Please visit https://go.microsoft.com/fwlink/?linkid=868517 to view the release notes.
.NET 10.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 10.0.20)
- Microsoft.Maui.Core (>= 10.0.20)
.NET 10.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 10.0.20)
- Microsoft.Maui.Core (>= 10.0.20)
.NET 10.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 10.0.20)
- Microsoft.Maui.Core (>= 10.0.20)
.NET 10.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 10.0.20)
- Microsoft.Maui.Core (>= 10.0.20)
.NET 10.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 10.0.20)
- Microsoft.Maui.Core (>= 10.0.20)
.NET 9.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 9.0.120)
- Microsoft.Maui.Core (>= 9.0.120)
.NET 9.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 9.0.120)
- Microsoft.Maui.Core (>= 9.0.120)
.NET 9.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 9.0.120)
- Microsoft.Maui.Core (>= 9.0.120)
.NET 9.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 9.0.120)
- Microsoft.Maui.Core (>= 9.0.120)
.NET 9.0
- SkiaSharp (>= 4.153.0-preview.1.26454.6)
- SkiaSharp.Views.Maui.Core (>= 4.153.0-preview.1.26454.6)
- Microsoft.Maui.Controls (>= 9.0.120)
- Microsoft.Maui.Core (>= 9.0.120)