Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Using SkiaSharp to edit Bitmap, how save it?

I'm using SkiaSharp with which i load Bitmap into canvas. I have touch reading too which allow me to draw on it (on canvas). Is there any option to save canvas (or this bitmap with my drawings on it) to gallery or just memory of device ?

void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
    {
        SKCanvas canvas = args.Surface.Canvas;
        SKImageInfo info = args.Info;
        canvas.Clear();
        if (photoBitmap != null)
        {
            canvas.DrawBitmap(photoBitmap,
                new SKRect(0, 0, info.Width, info.Height));
        }

        foreach (SKPath path in completedPaths)
        {
            canvas.DrawPath(path, paint);
        }

        foreach (SKPath path in inProgressPaths.Values)
        {
            canvas.DrawPath(path, paint);
        }
    }

Answers

Sign In or Register to comment.