Partager via


Working with the StylusInput APIs

Working with the StylusInput APIs

Implementation of the StylusInput application programming interfaces (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 or cancel the data associated with in-air packets, stylus down, packets, and stylus up 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 converts the tablet pen data stream to ink, and stores, manipulates, and statically renders the resulting 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-render and ink-collection plug-ins can be created to render to various contexts—such as to a file, a stream, or to a device using Microsoft® Windows® GDI+ or Microsoft DirectX®. Ink can also be stored in various formats, such as ink, a fortified Graphics Interchange Format (GIF) file, or an Ink Serialized Format (ISF) file.

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