SKGLView.DrawInSurface(SKSurface, GRBackendRenderTargetDesc) Method
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.
Caution
Use OnPaintSurface(SKPaintGLSurfaceEventArgs) instead.
Implement this to draw on the canvas.
public virtual void DrawInSurface (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget);
[System.Obsolete("Use OnPaintSurface(SKPaintGLSurfaceEventArgs) instead.")]
public virtual void DrawInSurface (SkiaSharp.SKSurface surface, SkiaSharp.GRBackendRenderTargetDesc renderTarget);
Parameters
- surface
- SKSurface
The surface to draw on.
- renderTarget
- GRBackendRenderTargetDesc
The render target that is currently being drawn.
- Attributes
Examples
public override void DrawInSurface (SKSurface surface, SKBackendRenderTargetDesc renderTarget)
{
// call the base method
base.DrawInSurface (surface, renderTarget);
var surfaceWidth = renderTarget.Width;
var surfaceHeight = renderTarget.Height;
var canvas = surface.Canvas;
// draw on the canvas
canvas.Flush ();
}
Remarks
There are two ways to draw on this surface: by overriding the DrawInSurface(SKSurface, GRBackendRenderTargetDesc) method, or by attaching a handler to the PaintSurface event.
Important
If this method is overridden, then the base must be called, otherwise the event may not be fired.
Note
If SkiaSharp version v1.68.x or greater is being used, then the OnPaintSurface(SKPaintGLSurfaceEventArgs) method should be overridden instead of DrawInSurface(SKSurface, GRBackendRenderTargetDesc).
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for