SKCanvasView.PaintSurface Event

Definition

Occurs when the the canvas needs to be redrawn.

public event EventHandler<SkiaSharp.Views.Mac.SKPaintSurfaceEventArgs> PaintSurface;

Remarks

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

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 ();
};
</div>

Applies to