Working with the StylusInput APIs
The RealTimeStylus class enables you to interact with the data stream from the tablet pen. To interact with the data stream, add a RealTimeStylus object to your application, and add plug-ins to the RealTimeStylus object.
The plug-ins can modify the data associated with in-air packets, stylus down, packets, and stylus up notification methods. The plug-ins can cancel the in-air packets and packets notification methods. The plug-ins can also add application data to the stream in the form of CustomStylusData objects. The following list offers ideas for common categories of plug-ins that you may want to use or create.
- Filter plug-in: An object that selectively removes or cancels data in the tablet pen data stream.
- Modifier plug-in: An object that selectively modifies data in the tablet pen data stream.
- Dynamic-renderer plug-in: An object that displays the tablet pen data in real-time as it is being handled by the RealTimeStylus object. Later, for events such as a form refresh, the dynamic renderer plug-in or an ink collection plug-in might redraw the ink.
- Recognizer plug-in: An object that scans the movement of the tablet pen for gestures, handwriting, or other glyphs.
- Ink-collector plug-in: An object that from the tablet pen data stream creates and stores ink.
- Wrapper plug-in: A plug-in that acts as an interface between the RealTimeStylus object and another plug-in or object as a way of modifying the behavior of the wrapped object.
Both dynamic-renderer and ink-collection plug-ins can be created to render to various contexts—such as to a file, a stream, or to a display device. Ink can also be stored in various formats, such as an Ink object, a fortified Graphics Interchange Format (GIF) file, an Ink Serialized Format (ISF) file, or other formats.
Two plug-ins are provided with the StylusInput APIs: the DynamicRenderer class and the GestureRecognizer class. The DynamicRenderer class provides basic rendering of the ink data in real time and is streamlined to have a minimal performance impact. The GestureRecognizer class provides gesture recognition for the RealTimeStylus class.
In This Section
- Working with the RealTimeStylus Class
- Plug-ins and the RealTimeStylus Class
- Plug-in Data and the RealTimeStylus Class
- Implementation Notes for the StylusInput APIs
- Ink-Collection Plug-ins
- Dynamic-Renderer Plug-ins
- Recognizer Plug-ins