How to Erase InkCanvas Strokes in Universal Windows Platform (Windows 10) app?
Asked Answered
V

1

6

Working with the InkCanvas control using the Universal Windows Platform (UWP) I can't seem to determine the correct method to erase ink strokes when using the InkCanvas - there's an event "StrokeErased" that can be handled.

Ideally the "InkCanvasEditingMode" on "InkCanvas.EditingMode" value to be set to either "InkCanvasEditingMode.EraseByPoint" or "InkCanvasEditingMode.EraseByStroke" would be used but these aren't available in the InkCanvas under Windows 10.

The example https://github.com/Microsoft/Windows-universal-samples/tree/master/simpleink mentions "Erase ink strokes" but the example just handles the StrokeErased event with no actual support for the erasing of them that I can see, what am I missing?

Vara answered 22/6, 2015 at 9:30 Comment(0)
A
4

To let the user erase strokes (similar to WPF's InkCanvasEditingMode) set the InkCanvas's InkPresenter's InputProcessingConfiguration.Mode to InkInputProcessingMode.Erasing .

canvas.InkPresenter.InputProcessingConfiguration.Mode = Windows.UI.Input.Inking.InkInputProcessingMode.Erasing;
Attractive answered 27/6, 2015 at 1:52 Comment(1)
I'd completely missed this somehow, works perfectly!Vara

© 2022 - 2024 — McMap. All rights reserved.