New version page

Tablet PC SDK

Upgrade to remove ads

This preview shows page 1-2-3 out of 10 pages.

Save
View Full Document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Upgrade to remove ads
Unformatted text preview:

Using the Tablet PC SDK in Visual Studio .NET Using C#v0.2a, JL Popyack, Feb. 2004 (Revised July 2004)Using the Tablet PC Software Development Kit (SDK)Update your .NET settings to include the Tablet PC SDK: Select Project -> Add Reference… and click the “.NET” tab. Scroll down to find Microsoft Tablet PC API v1.5 and select that, click the Select button, then click “the OK”.button.Make sure the Toolbox is visible. If it is not, select the “Toolbox” tab in the left margin of the Visual Studio. Right-click in the Toolbox window, and select Customize Toolbox… (In Visual Studio .NET 2003, select Add/Remove Items…) Find and select the InkEdit and InkPicture components by clicking the checkboxes beside these items. This allows Ink icons to appear in the Toolbox, for easy installation in your project.Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.To place an InkEdit object in your form, click on InkEdit, and drag it into place on the form, where it can be repositioned and resized. Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.Switch to Code View. At the top, add a line containing “using Microsoft.Ink;”Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.In the Solution Explorer window, select the Form1.cs icon, and select View->Properties Window (alternately, double-click the Form1.cs icon). You can modify the properties of Form1.cs. Change the default value of Text from “inkEdit1” to the null string.Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.Ink recognition is automatically turned on. Try running the program (select Build->Build Solution to build it, and Debug->Run without Debugging to run it.)The display font, size, style and color can be changed from the Properties menu. Click on the Ink Edit item, and click the “+” next to Font from the Properties menu. Various attributes such as Font, Size, and Color can be changed here. Below, we have set Font to Jokerman, Color to Red, and Size to 16:Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.Let’s create an application that will accept numbers as user input and total them. The form will look like this:Create this by placing InkEdit boxes for Score1, Score2, and Total. Modify the inputs through the Properties menu: Change the text for label1 to “Score 1”by selecting its Text property, and likewise for the other labels.Modify the display text for InkEdit1: change the text to null, font to 14 point, and likewise for InkEdit2 and InkEdit3. Ensure the boxes are the same size and are aligned vertically by modifying their Size and Location properties. (Each of these properties has two components; access them individually by clicking the “+” box next to the property name.)Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.Modify the title bar of the form by clicking it and changing its Text property.Test run the application. Each box has recognition turned on automatically. Try writing in numbers. How good is the recognition? We note it is not perfect. An InkEdit object allows factoids (i.e., hints) as to the type of its input. Initially, the factoid for InkEdit objects is DEFAULT. Some other possibilities are shown below:ONECHAR................ a single characterUPPERCHAR............ single upper case characterDIGIT......................... a single digitDATE......................... standard format datesTIME.......................... stardard form timeCURRENCY.............. various forms (including dollars, cents, pounds, euros, …)TELEPHONE............ phone numberEMAIL....................... standard-form email addressWEB........................... URLFILENAME............... file path formatWORDLIST............... you can specify a set of likely wordsNONE........................ you’re on your own!Specify the factoid to be used by an InkEdit object through its Factoid property. Can’t decide between DIGIT and NUMBER? Change the factoids for InkEdit1 to NUMBER and InkEdit2 to DIGIT and try both.Prepared for "Developing Software for the Tablet PC", JL Popyack, B Char, N Herrmann: Project DUPLEX, Drexel University, SIGCSE Technical Symposium, Mar.3, 2004. Revised for use by PGSIT, 2004.Note: you can also “OR” several factoids: EMAIL | WEB, for instance.For more robust development, the InkEdit type lacks some features, e.g., the ability to control what is collected. Whereas factoid hints are accepted, they are no guarantee that the text returned will conform to the factoid.Open the InkRecognition C# Project. Find the source code (in btnRecognize_Click) shown below. Follow the instructions (uncomment the code) and also comment out the last line (which calls the ToString() method. // Note that the Strokes' ToString() method is a // shortcut for retrieving the best match using the // default recognizer. The same result can also be // obtained using the RecognizerContext. For an // example, uncomment the following lines of code: // // using (RecognizerContext myRecoContext = new RecognizerContext()) // { // RecognitionStatus status; // RecognitionResult recoResult; // // myRecoContext.Strokes = myInkCollector.Ink.Strokes; // recoResult = myRecoContext.Recognize(out status); // txtResults.SelectedText = recoResult.TopString; // } txtResults.SelectedText = myInkCollector.Ink.Strokes.ToString();Run the program to verify that it still works.Next, add the following lines of code, before the


Download Tablet PC SDK
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Tablet PC SDK and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Tablet PC SDK 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?