Programming Windows TabletPC 101
Tablet computing is a compelling and growing technology. Using a pen-like stylus to interact with your laptop opens up a whole new aspect to using a computer, in general, and programming a computer, in particular. Granted, years ago tablet computing was not ready for prime time. Laptop hardware was not as developed as was necessary to support the technology and the basic software had a way to go to be viable. The joke about using a pen to write the word peg and having the computer understand the input as the word jog is very relevant and very frustrating. However, that was then and this is now. Today, using and programming TabletPC is surprisingly simple. Microsoft has built reliable handwriting recognition and high-resolution stylus management into Windows XP TabletPC Edition and in all versions of Windows Vista. In addition, the .NET TabletPC API takes away all the underlying difficulty that used to be the case for programming for TabletPC.
Given all the improvements that have come to pass over the last few years, TabletPC is a technology that will take hold in years to come—particularly in medicine and aeronautics.
In this article I’ll show you the basics that you need to know for programming WinForms on a TabletPC. I will cover basic hardware and operating system considerations unique to tablet computing. Then I’ll talk about Ink and Strokes, which are the building blocks of TabletPC graphics. Finally, I’ll show you how to write a simple TabletPC program that does handwriting recognition and then explain the more advanced features of the sample program that enables you to save and retrieve Ink-based data.
Understanding the TabletPC environment
Whereas in standard personal computing input is limited to the keyboard and mouse, in TabletPC computing, the primary input device is the stylus, with the keyboard and mouse playing secondary roles. As expected, you use the stylus to "write" on the surface of the TabletPC screen.
There are two types of interaction that can happen between stylus and screen: resistive and electromagnetic. A resistive interaction is one in which the TabletPC’s screen is pressure-sensitive only to the touch of the stylus. Therefore, the stylus must be in contact with the computer screen before any interaction can take place. Electromagnetic interaction, on the other hand, is one in which the TabletPC screen senses the presence of the stylus once the device comes within proximity. No contact between stylus and screen is required for interaction to take place. Thus, in an electromagnetic interaction you see the stylus cursor move across the screen at the location of the stylus, despite the fact that there is no contact between stylus and screen. However, there is no "writing magic." For writing to take place, contact must occur between stylus and screen. Whether a stylus is resistive or electromagnetic is dependent upon the TabletPC hardware. Most modern TabletPC laptops use electromagnetic technology for stylus/screen interaction.