8

I'm just playing around with Xamarin Forms and SkiaSharp. I've create a simple Xamarin forms ContentView with a SkiaCanvas. My PaintSurface is as follows to draw a simple green circle:

    private void canvas_PaintSurface(object sender, SKPaintSurfaceEventArgs e)
    {
        var view = (SKCanvasView)sender;
        var canvas = e.Surface.Canvas;

        using(var paint = new SKPaint())
        {
            paint.Color = Colours.XamarinGreen;
            paint.Style = SKPaintStyle.Fill;
            paint.StrokeWidth = 1;
            paint.IsAntialias = true;

            canvas.DrawCircle((float)view.Width / 2.0f, (float)view.Height / 2.0f, (float)view.Height / 2.0f, paint);
        }
    }

In my test app, when I resize the window by dragging the corner of the window the circle flickers. I was wondering is there an easy way to enable double buffering when drawing graphics with SkiaSharp in a Xamarin.Forms app?

  • Not about double buffering but if you drag the corner its like you're on windows and there is a hardware accelerated skia view available SKGLControl that has an option like VSync to be enabled.. – Nick Kovalsky May 15 '23 at 07:19

0 Answers0