Forum Libraries, Components, and Plugins
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.

Eraser in SkiaSharp (Finger Painting)

Is there any way to create an eraser to remove previously created SKPath's? I wish create a new transparent SKPath which will act as an eraser to any previously rendered SKPath's... Please, help me, guys, I'm really going nuts here, thanks in advance.


  • mario.moramario.mora USMember ✭✭

    I could achieve it by playing with the blending mode of the skpaint

    You have to set transparent color and blendmode as "Src", shomehow like this:

    SKPaint _paint = new SKPaint
    Style = SKPaintStyle.Stroke,
    StrokeCap = SKStrokeCap.Round,
    StrokeJoin = SKStrokeJoin.Round,
    Color = _isDeleting? Color.Transparent : SomeForeColor,
    BlendMode = _isDeleting? SKBlendMode.Src : SKBlendMode.SrcOver

    when _isDeleting=true, then the drawing action will replace everything in its path for whatever is behind on that canvas' object (color or image)

Sign In or Register to comment.