Поделиться через


Dynamic-Renderer Plug-ins

Dynamic-Renderer Plug-ins

Overview of dynamic-renderer plug-ins.

A dynamic-renderer plug-in is 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-collector plug-in may redraw the ink.

The DynamicRenderer Object

The DynamicRenderer object implements the IStylusSyncPlugin interface. The DynamicRenderer object renders the ink in real-time, as it is being drawn. By default, when the Refresh method is called, the DynamicRenderer object redraws the Stroke object currently being collected. The DynamicRenderer object only performs this rendering while its Enabled property is set to true. The DynamicRenderer object's Enabled property is initially set to false.

When calling the DynamicRenderer object's Refresh method from within a Paint Leave Site event handler, set the DynamicRenderer object's ClipRectangle property to the PaintEventArgs Leave Site object's ClipRectangle Leave Site property.

The DynamicRenderer object can temporarily cache ink data. To use this feature, set the EnableDataCache property to true. When the DynamicRenderer object receives a call to its IStylusSyncPlugin.StylusUp method, it caches the stroke data and adds custom stylus data to the Input queue in response to the StylusUpData object for the stroke. The CustomStylusData object's CustomDataId property is set to the DynamicRendererCachedDataGuid value, and the CustomStylusData object's Data property contains a DynamicRendererCachedData object. Call the DynamicRenderer object's ReleaseCachedData method once the stroke has been collected and can be statically rendered.

The DynamicRenderer object is implemented as a Component Object Model (COM) wrapper, and you can not call its IStylusSyncPlugin interface methods directly. For more information about COM operation and the RealTimeStylus object, see Implementation Notes for the StylusInput APIs.

Custom Rendering

You can create your own dynamic-renderer plug-in by creating a synchronous plug-in that subscribes to the StylusDown, Packets, and StylusUp notifications. Your plug-in can then render the stroke as it is being drawn. This may be one way of implementing a selection tool that uses a free-form selection or selection box, for example.