Working with Tablet PC InkPicture Control in C#


Tablet PC SDK provides two very powerful but easy to user Ink controls for Ink recognition. These two controls are - InkEdit and InkPicture. This article discusses how to work with InkPicture control.

Adding Tablet PC Ink Controls

Ink recognition controls are controls that recognizes Tablet PC Ink and provides functionality to work with Ink. Ink controls are installed as .NET components and defined in the Microsoft.Ink namespace, which means both controls are managed controls. These controls are a part of Tablet PC SDK. If you are running a Windows XP Tablet PC edition, you do not have to install Tablet PC SDK.

You can add Ink Controls to the Toolbox by right clicking on the Components tab of Toolbox and select Add/Remove Items, which launches Customize Toolbox dialog. Select InkEdit and InkPicture check boxes and click OK. ( See Figure 1).


Figure 1. Adding Ink Controls to Toolbox.

Once these controls are added to Toolbox, you can simply drag and drop them to the Form and work with them. See Figure 2.

Figure 2. InkEdit and InkPicture controls.

InkPicture Control

InkPicture control is an extended version of Windows Forms PictureBox control. Besides the standard PictureBox functionality, this control is Ink enabled, which means if you draw on top of the image using Tablet PC Ink Pen, the control recognizes the ink. You can also save ink as it was drawn and the later load it back.

To test the InkPicture control, I create a Windows Forms application and drags InkPicture control to the Form. Download InkPicture Source code here. Now if you run the application, you will notice the InkPicture control is ready to accept ink input. Figure 3 shows the ink enable InkPicture control.

Figure 3. InkPicture control with ink.

Summary

InkPicture control is an extended version of Windows Forms PictureBox control. Besides the standard PictureBox functionality, this control is Ink enabled, which means you can write on the control by using a mouse or Tablet PC pen. In this article, we covered how to use this control at design-time without writing a single line of code. In my forthcoming article, I will discuss how to write, save, and load ink on this control.

Up Next
    Ebook Download
    View all
    Learn
    View all