Introduction
In the previous part we saw some of the core features of the Tablet PC. We also looked at the various updated features of the API's which help in developing ink aware applications.
Before we see how development is done with these controls, let me give you a clear picture on how these controls work and how they can be redistributed.
The core functionality for recognizing the ink and converting the same to text is known as digitizing. This is build into the Tablet PC Operating system and hence when the application is distributed to a user having a Tablet PC, he will be able to work since the core requirements for the application is build into the Tablet PC. The Tablet PC SDK 1.7 is available as a free download. This SDK can also be installed on a Windows XP Professional PC and the developer can develop applications for the Tablet PC. The only disadvantage is that he will not be able to get recognition for the ink since XP Professional does not have the in-build recognizer. Also the redistributable files cannot be distributed to non-Tablet PC users.
Let us see some of the core controls that have been build into the Tablet PC SDK 1.7 to provide support for inking.
InkEdit Control
The primary use for InkEdit is to get text input from a user in the form of handwriting. By default, ink input is recognized and text is inserted in its place. The default user interface for InkEdit resembles that of the RichTextBox control, except when the user is laying down ink. InkEdit is designed to work well in a form scenario for single line as well as multi-line text entry and editing.
InkPicture Control
The InkPicture control allows you to easily place an image (.jpg, .bmp, .png, or .gif format) in an application so that users can add ink to. It is intended for scenarios in which ink does not need to be recognized as text, but will instead be stored as ink. Users add ink to a transparent layer using a pen. Users can re-size an InkPicture window without losing any ink information, even if the ink is cropped when re-sizing.
Let us see with an example on how a simple ink aware application can be developed with the Tablet PC SDK on a Tablet PC. For this demonstration the following are required.
A Tablet PC with Windows XP SP2.
The Tablet PC SDK 1.7.
Visual Studio .NET 2003.
A digitizer to enable support for writing.
As we saw in the previous section, Windows XP SP2 is needed for developing applications because XP SP2 included the ability to implement ink in all the applications of Windows. This demonstrations and samples will not work on a Tablet PC that does not have XP SP2 installed. Note that development for the Tablet PC doesn't require any additional learning but it is build on top of the existing .NET Framework 1.1 and the developer only has to extend support for inking with the help of the controls mentioned above.
Start Visual Studio .NET 2003 and then select a Windows Application. Save it in a location of your preferences.
Now we have to make a reference to Microsoft Ink Controls so that we can implement ink aware controls in our application. Right click on the toolbox and then click "Add/Remove Items". The familiar dialog box for adding and removing controls appears. Note that the majority of the controls provided by Windows appears here.
Check the two boxes which says InkEdit and InkPicture. This will ensure that the controls are added to the toolbox so that they can be used in the project. Click on Apply and now the controls are added to the toolbox.
Now drag and drop an InkEdit and InkPicture control onto the screen so that they are aligned as seen in Figure 4. Note that the control at the top is an InkEdit control and the one at the bottom is a InkPicture control.
Since we are using a pen tablet to capture the ink we will have to make some adjustments to the InkEdit control.
First change the "UseMouseForInput" property to true. This will enable using the mouse or a pen on the InkEdit control so that ink can be captured. Leave the rest of the properties to the default settings.
That is all that is required to be done. Now we can run the form and see how ink is captured. Press F5 and then wait till the form loads up.
Now when the pen is moved over the InkEdit control it is seen that the pointer turns into a pen point and it is a visual indicator that it is ready to accept ink. Now let us write some text with the pen and see what happens. Viola the hand written text is seen over the control. This is seen in Figure 6.
Now let us wait and see what happens when we stop writing with the pen. The handwritten text is converted to text and it is seen in the textbox. This is evident from Figure 7.
Now let us focus on the other control InkPicture. By default this does not convert the handwriting to text but preserves the text as it is written and this can be saved to a image file. This can be seen in Figure 8.
We have seen a lot what can be done with the Tablet PC SDK 1.7. We also saw how the integration of the Tablet PC SDK 1.7 has been integrated with visual studio .net 2003 and also how it was possible to add the ink aware controls to the tool box and also develop some applications using the ink aware controls.
In the next part we will dive deeper into the development of ink aware applications and show how it is possible to develop applications that can be used for day to day life with the help of inking.