SkiaSharp.Views.Mac.SKCanvasView.PaintSurface Event

Occurs when the the canvas needs to be re-drawn.

Syntax

public event EventHandler<SKPaintSurfaceEventArgs> PaintSurface

Remarks

There are two ways to draw on this surface: by overriding the SKCanvasView.DrawInSurface method, or by attaching a handler to the SKCanvasView.PaintSurface event.

C# Example

SKCanvasView myView = ...;

myView.PaintSurface += (sender, e) => {
    var surface = e.Surface;
    var surfaceWidth = e.Info.Width;
    var surfaceHeight = e.Info.Height;

    var canvas = surface.Canvas;
    // draw on the canvas
    canvas.Flush ();
};

Requirements

Namespace: SkiaSharp.Views.Mac
Assembly: SkiaSharp.Views.Mac (in SkiaSharp.Views.Mac.dll)
Assembly Versions: 1.55.0.0, 1.56.0.0, 1.57.0.0, 1.58.0.0, 1.59.0.0