Code

C#

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
  1. The editor exposes a pre-created canvas (SKCanvas) — draw on it directly.
  2. You can using-declare paints, paths, and fonts as normal; the fiddle disposes them.
  3. Click Run (or Ctrl+Enter) to render and see the output on the right.
  4. Use Share to get a permalink to your sketch.
SkiaSharp Docs Open Fiddle in New Tab