SKGLControl.OnPaintSurface(SKPaintGLSurfaceEventArgs) Method
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.
Implement this to draw on the canvas.
protected virtual void OnPaintSurface (SkiaSharp.Views.Desktop.SKPaintGLSurfaceEventArgs e);
The event arguments that contain the drawing surface and information.
protected override void OnPaintSurface (SKPaintGLSurfaceEventArgs e)
{
// call the base method
base.OnPaintSurface (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 ();
}
There are two ways to draw on this surface: by overriding the OnPaintSurface(SKPaintGLSurfaceEventArgs) method, or by attaching a handler to the PaintSurface event. If the method is overridden, then the base must be called.
Tärkeä
If this method is overridden, then the base must be called, otherwise the event will not be fired.
Tuote | Versiot |
---|---|
SkiaSharp Views | 1.60.x, 1.68.x, 2.80.x, 2.88.x |
Tuotteen SkiaSharp palaute
SkiaSharp on avoin lähdekoodi projekti. Anna palautetta valitsemalla linkki: