Search code examples
c#.netuwpinkcanvasstylus-pen

How To Custom Render UWP Wet Ink


In WPF, you could override the OnDraw to create a custom geometry to render as the 'wet' ink, although it increases latency quite a bit since you're not using the geometry provided and already calculated. I'm wondering if it is possible to achieve something similar in UWP. Suppose I wanted my pen to stroke to be jagged and zig-zagy. The 'dry' ink would be simple to implement with custom drying and all, but is there any way for my 'wet' ink to achieve this effect as well?


Solution

  • Win2D has capabilities to render ink, you could use CanvasControl to render ink strokes with InkCanvas.

    The CanvasControl has a Draw event, you could collect the 'wet' ink strokes and render it in this event.

    There’s an official Win2D sample called ‘InkExample’, if you want, you could check it.