After the ink is collected, applications can manage, manipulate, and transfer that data to other media. The actions of selecting, copying, moving, saving, viewing, and altering of the ink take place on the Ink object and its contained members, such as the Strokes collection and Stroke object.
An Ink object is the fundamental data type that manages, manipulates, and stores the input collected from the InkCollector object. An Ink object contains one or more Stroke objects and common methods and properties to manage and manipulate those strokes. A stroke is defined as the set of data that is captured in a single pen-down, pen-move, and pen-up sequence. The stroke data contains a collection of packets. A packet is the set of data that the tablet device sends at each sample point. This data contains information such as coordinates, pen pressure, pen angle, and anything else that the hardware can transmit. The PacketDescription property described the packets that a Tablet generates.
You can obtain a snapshot of the strokes in an Ink object by getting the Ink object's Strokes property. The Strokes property is a collection of references to the strokes in the Ink object at the time the Strokes property is read. If strokes are subsequently added to or deleted from the Ink object, a previously obtained Strokes collection is not updated. Furthermore, the Strokes property is a value and, like any value, goes out of scope unless it is assigned to a variable.
To keep a Strokes property synchronized with an Ink object, wrap it in an event handler for the StrokesAdded and StrokesAdded events. The handler should obtain a new copy of the Strokes property when either event is fired. Be careful not to add the event handler to a Strokes collection that is out of scope before the event is fired.
The PacketDescription property defines the set of information that the application gets from a Tablet PC device. The information typically includes coordinates, but it can include much more detailed information (depending on what the Tablet PC digitizer can produce) such as pen pressure or pen angle. By setting packet descriptions on the ink collector object before any ink is collected, you have full control over which of the Tablet PC devices properties you want to use.
The Renderer object is responsible for rendering Ink. Given an appropriate drawing context, the Renderer object can map ink space coordinates to pixels, apply viewing transforms, and display Ink on screens and printers. Draw and DrawStroke are the primary methods for rendering ink. For more information about displaying ink in a window, see Renderer object.
A stroke normally begins when the pen is lowered to the drawing surface and ends when the pen is raised. Within a stroke, the peaks, angles, and radical changes of directions are called cusps. The endpoints of a stroke are also considered cusps. For example, the capital letter "L" has three cusps, one in the middle and one at each end.
As a stroke is entered, it is normally smoothed and rendered using a Bezier (or polyline) curve. Bezier curves may turn cusps into small loops. For example, the peak of the cursive letter "i" might be smoothed to resemble the cursive "e". To prevent this, Microsoft® renderers have a "pre-Bezier" phase that handles the cusps differently.
Cusps can also be used to subdivide Stroke objects into erasable units. For example, selecting the vertical side of a capital "L" could indicate erasing just that side. The part of the stroke to be erased would be the part between two cusps.