SKGLView.PaintSurface Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the surface needs to be redrawn.
public event EventHandler<SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs> PaintSurface;
public event EventHandler<SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs>? PaintSurface;
Event Type
Examples
SKGLView myView = ...;
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.