locked
Inking within C++/CX windows store app

    Question

  • There are many examples on how to put together inking styled applications in JavaScript and a lot of it overlaps in a self-explanatory fashion within C++. However, when it comes time to actually draw the ink in real-time as the stylus passes over the screen, there seems (to me) to be a disconnect on how I should be putting the 'ink' on the screen.

    Using the InkManager, I trust that the text recognition, and StrokeSegments, etc. are in place. However, it seems in C++/CX that I need to manually modify the bytes within the pixel buffer of an Image UIElement in order to get the inking to display on the screen. Am I right about this? Or is there some, easier, interface available to facilitate this?

    One additional note: I see that there is a way to construct line segments, and poly line segments, etc. However, I can't seem to find a way to get these to display on the screen as the user's stylus passes over the screen.

    Thanks for any help!

    Monday, April 29, 2013 9:12 PM

Answers

  • The InkManager doesn't do any drawing. It just provides a description of the strokes. You can use this with any drawing engine. If you want to use Xaml you can either update a WriteableBitmap's PixelBuffer (as you describe) or add Path objects to a Canvas.

    See Input: Simplified ink sample . The C++ version uses DirectX. The C# version demonstrates Xaml and should be a straightforward port to C++/Cx.

    --Rob

    • Marked as answer by AfroFire Monday, April 29, 2013 10:11 PM
    Monday, April 29, 2013 9:34 PM
    Owner

All replies

  • The InkManager doesn't do any drawing. It just provides a description of the strokes. You can use this with any drawing engine. If you want to use Xaml you can either update a WriteableBitmap's PixelBuffer (as you describe) or add Path objects to a Canvas.

    See Input: Simplified ink sample . The C++ version uses DirectX. The C# version demonstrates Xaml and should be a straightforward port to C++/Cx.

    --Rob

    • Marked as answer by AfroFire Monday, April 29, 2013 10:11 PM
    Monday, April 29, 2013 9:34 PM
    Owner
  • Ah, the whole time there was a "Simplified Ink Sample" I didn't see.

    Many thanks Rob, I think this answers my questions just fine and dandy!

    Monday, April 29, 2013 10:11 PM