Code
C#
Basic Shapes
DrawRect, DrawCircle, DrawOval, DrawLine — the core SkiaSharp drawing primitives.
Paint & Colors
SKPaint styles, stroke width, anti-alias, alpha, and dash effects.
Paths
SKPath — LineTo, CubicTo, ArcTo, star polygons, and filled shapes.
Text Rendering
DrawText with SKFont — bold/italic typefaces, stroke text, and MeasureText.
Gradients
Linear, radial, and sweep gradient shaders via SKShader.
Image Filters
Gaussian blur, drop shadow, and colour-matrix filters with SKImageFilter.
Transforms
Translate, RotateDegrees, Scale, Skew — and the Save/Restore stack.
Fiddle
Write and run SkiaSharp C# code live in the official interactive fiddle.
SkiaSharp Fiddle
Interactive Write C# SkiaSharp drawing code and see the rendered output instantly — powered by the official SkiaSharp online fiddle. Open Fiddle
Starter snippet
Copy this into the fiddle editor and click Run to see all the drawing primitives at once.
// SkiaSharp Fiddle — starter template
// Docs: https://mono.github.io/SkiaSharp/index.html
canvas.Clear(SKColors.White);
using var paint = new SKPaint { IsAntialias = true };
// ── Gradient background strip ─────────────────
paint.Shader = SKShader.CreateLinearGradient(
new SKPoint(0, 0), new SKPoint(256, 0),
new[] { new SKColor(79, 70, 229), new SKColor(219, 39, 119) },
null, SKShaderTileMode.Clamp);
canvas.DrawRect(0, 0, 256, 50, paint);
paint.Shader?.Dispose();
paint.Shader = null;
// ── Filled circle ─────────────────────────────
paint.Style = SKPaintStyle.Fill;
paint.Color = new SKColor(245, 158, 11);
canvas.DrawCircle(64, 140, 50, paint);
// ── Stroked rect ──────────────────────────────
paint.Style = SKPaintStyle.Stroke;
paint.StrokeWidth = 3;
paint.Color = new SKColor(22, 163, 74);
canvas.DrawRoundRect(140, 90, 100, 80, 12, 12, paint);
// ── Cubic Bézier path ─────────────────────────
paint.Style = SKPaintStyle.Stroke;
paint.Color = new SKColor(14, 165, 233);
paint.StrokeWidth = 2;
using var path = new SKPath();
path.MoveTo(10, 240);
path.CubicTo(80, 170, 180, 310, 246, 240);
canvas.DrawPath(path, paint);
// ── Text ──────────────────────────────────────
paint.Style = SKPaintStyle.Fill;
paint.Color = SKColors.DarkSlateGray;
using var font = new SKFont(SKTypeface.Default, 18);
canvas.DrawText("Hello from SkiaSharp!", 10, 256, font, paint);How to use the fiddle
- The editor exposes a pre-created
canvas(SKCanvas) — draw on it directly. - You can
using-declare paints, paths, and fonts as normal; the fiddle disposes them. - Click Run (or Ctrl+Enter) to render and see the output on the right.
- Use Share to get a permalink to your sketch.