So from my basic understanding I have created an SKCanvasView and gets the finger painting working like in all the samples...etc. Just trying to find what is the way to clear my SKCanvasView? Does anyone have an example? I'd just like to have a button to clear the canvas. Or point me in the right direction
<Grid> <Grid x:Name="CanvasGrid"> <forms:SKCanvasView x:Name="CanvasView" PaintSurface="PaintSurface"/> </Grid> <Grid.Effects> <helpers:TouchEffect Capture="True" TouchAction="OnTouchEffectAction"/> </GridEffects> </Grid> <Button Text="Clear" Clicked="ClearCanvas"/>
THanks.
I'm doing some hacky thing in the code behind attached to a button:
CanvasGrid.Children.Clear(); CanvasGrid.Children.Add(CanvasView); completedPaths.Clear();
Is there a better way to do this. Thanks.
Answers
I'm doing some hacky thing in the code behind attached to a button:
Is there a better way to do this. Thanks.
in your "PaintSurface" handler get a reference to the canvas and then use canvas.Clear(SKColors.White);