Utilizing InkEdit, InkPicture, And Enhancing The appearance Of Ink
Leszynski Group Inc.
Microsoft® Windows® XP Tablet Pc Version
Summary: This text discusses utilizing ink controls for the Microsoft Windows XP Tablet Computer Version operating system. We’ll talk about the InkEdit and InkPicture controls, which are supplied in the Pill Pc SDK. We may also cowl enhancing the appearance of ink strokes within these controls. This discussion covers practical application and potential benefits.
This text is intended for builders creating ink-based functions. Code samples had been created utilizing Microsoft Visible Basic .Net and C#, and the Microsoft Tablet Computer Platform SDK (Beta) Build 2149. (9 printed pages)
Utilizing the InkEdit management
Utilizing the InkPicture Management to Annotate
The InkEdit and InkPicture controls give developers options when creating ink-enabled functions for different user eventualities. In some circumstances, builders might want the management to acknowledge ink, and, in different cases, developers could not. The identical is true for displaying picture files as a background, or leaving it clean. InkEdit and InkPicture present this flexibility.
The InkEdit and InkPicture controls provide the power to capture ink and perform handwriting recognition. However, there is no textual content display space within an InkPicture control.
Using the InkEdit management
The InkEdit management is derived from the RichTextBox base class. In default the default configuration, the control captures ink, acknowledges the handwriting, removes the ink, after which shows the recognized ink as textual content inside the text field. This enables customers to enter textual content utilizing the pen as an alternative of the keyboard. Recognition is quick.
Including InkEdit to Visible Studio
To use the InkEdit control, add it to your Microsoft® Visible Studio® .Web Toolbox.
1. Right-click on the Toolbox.
2. Choose Customise Toolbox.
3. Choose the .Internet Framework Components tab.
Four. Check InkEdit after which click Okay.
You can even add this management by referencing and creating it in code. However, including it to your Toolbox is the quickest means.
Adding InkEdit to Your Kind
So as to add an instance of the InkEdit management to your type, select the InkEdit management in your Toolbox, after which draw a rectangle area in your form.
Enabling InkEdit and Mouse Input
By default the InkEdit control will collect ink and gestures from a pen enter machine on a Pill Pc.
If you are creating ink-enabled applications on a desktop machine with no pen enter device, you won’t be able to attract ink inside of the InkEdit management. The following setting allows you to make use of your mouse as a pen enter device inside of the InkEdit control:
Now you can follow utilizing the InkEdit management. Figure 1 illustrates the written yepme men’s casual shirts ink.
Determine 1. Handwritten ink
Determine 2 illustrates the text displayed after the control has carried out textual content recognition.
Figure 2. Handwritten ink after textual content recognition by the InkEdit management
There could also be a situation when you do not want the InkEdit management to recognize the ink and display it as textual content. You possibly can set the control to shrink and organize the ink into distinctive traces on the management. This is able to permit the person to write down a letter or seize the user’s signature. Nonetheless, this function will only work on the Tablet Computer version of Home windows XP.
To retain ink inside the management, set the next property:
Now you’ll be able to run your sample once more. Write “Hey” and discover that the ink is reduced in dimension and positioned in-line throughout the InkEdit management.
You’ll be able to control the quantity of delay time between the top of a stroke and the start of the text recognition by changing the next property, the place n is a 32-bit number that indicates the number of milliseconds between the final ink stroke collected and the start of the recognition:
The default worth is 2000 (two seconds). The default worth works nicely, however there may be some cases whenever you need a longer or shorter delay. For example, should you have been writing a training program for elementary college children, you’ll slow down the delay to offer the youngsters extra time to complete writing their words.
A factoid offers context for acknowledged ink in the context of a selected discipline. The Factoid property returns or sets the identify of a factoid that the recognizer makes use of to constrain its seek for the recognition results.
Usually, you’d specify a factoid provided that an input subject is of a identified type, resembling a date subject. A number of the supported Factoids are: PostalCode, E-mail, Web, Phone, Filename. For extra details about factoids and how to use them, see Utilizing Factoids within the Tablet Laptop SDK Documentation. For a listing of supported factoids, seek for the Factoid object and for Supported Factoids in the Tablet Pc SDK Documentation.
To change the Factoid on the InkEdit control, set the next property, where [Name] is the title of one of many supported Factoids:
Setting the ZoomFactor
The ZoomFactor property will increase or decreases the magnification of the text or ink within the management. The default worth is 1.Zero, which makes the management contents seem at 100 percent. Larger values will trigger the textual content or ink contained inside the control to seem bigger. Smaller values will make the textual content or ink appear smaller. You might want to extend this worth for users with visual impairments who may benefit from a bigger rendering of the text or ink.
You can change the following property to set the zoom value, the place n is a single precision number:
Saving InkEdit Contents
You can save the contents of your InkEdit management by calling the .SaveFile methodology. This overloaded technique will allow you to save to a file or a stream. The next instance saves the file to “C:\MyInk.rtf”:
Opening Saved InkEdit Recordsdata
Opening an InkEdit file is achieved through the use of the .LoadFile method. This overloaded methodology will enable you to open from a file or a stream. The following example opens a file from “C:\MyInk.rtf”:
Using the InkPicture Control to Annotate
The InkPicture control is derived from the picture base class and offers a space during which the consumer can annotate. This control is useful for capturing signatures, drawings, markups, or different annotation that want not be recognized as textual content.
This management may include an image onto which the consumer can draw, which is beneficial in instances the place the underlying image is a scanned form. The accepted picture file formats for InkPicture include: .jpg, .bmp, .png, or .gif format.
Including InkPicture to Visual Studio
To use the InkPicture management, add it to your Visible Studio .Internet Toolbox.
1. Proper-click on the Toolbox.
2. Select Customize Toolbox.
3. Choose the .Web Framework Elements tab.
4. Test InkPicture and click on Ok.
Add InkPicture to Your Form
You may add an occasion of the InkPicture management to your form by deciding on the InkPicture management in your Toolbox. Then draw a rectangle region in your form. Again, it is vital that you make the management giant enough for users to simply write several words contained in the management boundaries.
It is not required that you just place an image within the control. To create a area where customers can draw pictures or annotate, you’ll be able to leave the Picture property empty.
By default, the InkPicture control captures and shows Ink. You do not must set any properties to activate this control at run time.
By default, ink that’s drawn on the InkPicture management is just not anti-aliased, or smoothed. This can lead to jagged edges and blocky wanting strokes. You may anti-alias and curve strokes in the InkPicture control. This improves the aesthetic appearance of strokes, particularly on machines with low resolution.
The next code units each anti-aliasing and curving processes:
In VB .Net
The InkEdit and InkPicture controls provide broad performance when growing for various consumer situations. You should utilize the InkEdit for scenarios when textual content recognition is required, reminiscent of deal with text boxes, and use InkPicture for eventualities when you do not want text recognition, comparable to when it is advisable to capture signatures. You may also lay photos within the InkPicture management. These controls present both flexibility and ease of use for builders and customers alike.
About Leszynski Group Inc.
Leszynski Group develops line-of-enterprise functions and retail software built around databases, XML, and ink, using Microsoft® .Web architecture. Leszynski Group was the first solution provider to develop and yepme men’s casual shirts ship ink-based mostly applications for the Tablet Computer.