SKGLControl.PaintSurface Event

Definition

Occurs when the surface needs to be redrawn.

public event EventHandler<SkiaSharp.Views.Desktop.SKPaintGLSurfaceEventArgs> PaintSurface;

Event Type

Examples

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

    var canvas = surface.Canvas;

    // draw on the canvas

    canvas.Flush ();
};

Remarks

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

Applies to