public override void DrawInContext(CGContext ctx) { base.DrawInContext(ctx); // create the skia context SKImageInfo info; var surface = drawable.CreateSurface(Bounds, IgnorePixelScaling ? 1 : ContentsScale, out info); // draw on the image using SKiaSharp DrawInSurface(surface, info); SKDelegate?.DrawInSurface(surface, info); // draw the surface to the context drawable.DrawSurface(ctx, Bounds, info, surface); }
public override void DrawInContext(CGContext ctx) { base.DrawInContext(ctx); // create the skia context using (var surface = drawable.CreateSurface(Bounds, IgnorePixelScaling ? 1 : ContentsScale, out var info)) { // draw on the image using SKiaSharp OnPaintSurface(new SKPaintSurfaceEventArgs(surface, info)); #pragma warning disable CS0618 // Type or member is obsolete DrawInSurface(surface, info); SKDelegate?.DrawInSurface(surface, info); #pragma warning restore CS0618 // Type or member is obsolete // draw the surface to the context drawable.DrawSurface(ctx, Bounds, info, surface); } }