I created a UWP project and am using InkCanvas to capture and render input from a Microsoft Surface pen.
All of it works, until I apply a 3D projection to the <Grid> element housing the <InkCanvas>. Here, I have a <PlaneProjection> int the XAML markup and adjust its RotationY in C#. When RotationY!=0.0, all of the ink disappears. Is there a solution?
I can work around this problem by rasterizing a list of InkStrokes and showing an <Image> instead. I looked around on Google but it seems I would need some super fancy Direct2D pipeline. Any advice?
I was able to find a workaround to this problem using rasterization. However the asynchronous nature of the workaround may lead to race conditions if you are not careful.
Xaml:
C#:
The above code is not tested, but it represents the general idea of the working code in my application.
During my testing, I found that I could only rasterize an InkCanvas that was in the xaml element tree and had Visibility.Visible. I was not able to rasterize an InkCanvas that was stored only in memory.
Another user posted a similar solution. Please see stackoverflow.com/a/72282615/5166365.