I am using the new Ink technology for Windows 10, by using InkCanvas/InkPresenter in UWP. Ink rendering is really nice, except I can't seem to be able to erase only a portion of a stroke. I am looking at OneNote, that I am assuming is using the same technology, and they do offer erasing of portion of a stroke. I know this wasn't possible when the InkCanvas/InkPresenter was first introduced, but I was wondering if there is a method to achieve this? Some way to mask the stroke to fake the eraser, maybe? Anyone has a suggestion?
Asked
Active
Viewed 428 times
1 Answers
-1
You can have a look at Microsoft's Coloring book sample where you can erase cell(Portion of stroke). They have created a Custom InkToolbar with flood fill, erase cell and much more.
https://github.com/Microsoft/Windows-appsample-coloringbook
Hope it helps.
Edit
You can intercept default inkcanvas events and set handler to avoid the event to take place.
CoreInkIndependentInputSource core = CoreInkIndependentInputSource.Create(inkCanvas.InkPresenter); core.PointerPressing += ViewModel.Core_PointerPressing;
core.PointerReleasing += ViewModel.Core_PointerReleasing;
core.PointerMoving += ViewModel.Core_PointerMoving;
-
Really nice example. Unfortunately erase cell is NOT erasing a portion of the stroke, but just a filled area. I am trying to develop my own algorithm, but I will need to disable the pen eraser. Do you have a suggestion for that, or should I post another question about it? – ClaudiaWey Dec 07 '18 at 01:19
-
1You can intercept default inkcanvas events and set handler to avoid the event to take place. CoreInkIndependentInputSource core = CoreInkIndependentInputSource.Create(inkCanvas.InkPresenter); core.PointerPressing += ViewModel.Core_PointerPressing; core.PointerReleasing += ViewModel.Core_PointerReleasing; core.PointerMoving += ViewModel.Core_PointerMoving; – Vignesh Dec 07 '18 at 04:29