Microsoft introduced the InkCanvas into the Universal Windows Platform as a way of apps leveraging the power of ink with devices like the Surface Pro’s and Surface Hub being quite well-known for their use of the pen.

When it comes to devices like the Surface Hub, these are capable of multi-user interactions using touch and pen meaning that a user can be doing something at the left hand side of the screen while another is working on the right, such as, annotating using pen on a map or a OneNote collaboration.

For developers, this is not an out-of-the-box property that you can just turn on in the InkCanvas control however. You need to go a little deeper and start customizing the properties of the InkPresenter which is used to render the ink you see on the InkCanvas.

How to enable multi-user input on the InkCanvas

When your page loads, you’re going to want to change a couple of properties on your InkCanvas’s InkPresenter to get started with this.

First, enable the input types you want your drawing canvas to support as follows:

I’ve provided two options to show how this works, you don’t have to use both in your own code.

So now we have a way of manipulating ink on the InkCanvas. Now it’s time to enable multi-user input inking.

To do this, we need to enable custom drying first. We do this so that we can overwrite the default drying method used by the InkPresenter which turns the wet ink that you’re currently drawing into dry ink when you’ve stopped. Doing this will allow us to set the property that allows multi-user input. You can do this as follows:

And there you go. If you now run your application, you can start using multiple fingers to draw on the InkCanvas if you have touch enabled, or if you’re working with the Surface Hub, you can now pick up both pens and start drawing simultaneously!

Author James Croft

James is a senior software developer for Black Marble and Microsoft MVP in Windows Development with over 6 years of experience developing applications for the Windows platform. James’s passion for learning new technologies gives him the opportunities to expose them to the wider community through tutorials, lessons learned and best practices through his online blog site, personal YouTube channel, and local communities through talks at events, schools and universities.

More posts by James Croft

Leave a comment