다음을 통해 공유


DynamicRenderer.DynamicRenderer Constructor

DynamicRenderer.DynamicRenderer Constructor

Creates a DynamicRenderer object.

Definition

Visual Basic .NET Public Sub DynamicRenderer( _
ByVal control As Control _
)
C# public DynamicRenderer(
Control control
);
Managed C++ public: DynamicRenderer(
Control *control
);

Parameters

control System.Windows.Forms.Control. The control on which the tablet pen data is displayed.

Remarks

This is a sealed class.

Although you typically initialize the DynamicRenderer and RealTimeStylus with the same Control Leave Site or window handle, it is possible to initialize them with different objects, if you would like to render the ink in a different window from where the stroke packets are generated.

Examples

[C#]

This C# example shows the event handler for the Load Leave Site event for a form that implements IStylusAsyncPlugin. A new instance of a DynamicRenderer object, theDynamicRenderer, and a RealTimeStylus, theRealTimeStylus, are initialized, associated with the form, and enabled.

using Microsoft.StylusInput;
// ...
private RealTimeStylus theRealTimeStylus;
private DynamicRenderer theDynamicRenderer;
// ...
private void InkCollection_Load(object sender, System.EventArgs e)
{
    theDynamicRenderer = new DynamicRenderer(this);
    theRealTimeStylus = new RealTimeStylus(this, true);

    // Add the dynamic renderer to the synchronous plugin notification chain.
    // Synchronous notifications occur on the pen thread.
    theRealTimeStylus.SyncPluginCollection.Add(theDynamicRenderer);

    // Add the form to the asynchronous plugin notification chain.  This plugin
    // will be used to collect stylus data into an ink object.  Asynchronous
    // notifications occur on the UI thread.
    theRealTimeStylus.AsyncPluginCollection.Add(this);

    // Enable the real time stylus and the dynamic renderer
    theRealTimeStylus.Enabled = true;
    theDynamicRenderer.Enabled = true;
}

[VB.NET]

This Microsoft® Visual Basic® .NET example shows the event handler for the Load Leave Site event for a form that implements IStylusAsyncPlugin. A new instance of a InkCollector object, theDynamicRenderer, and a RealTimeStylus, theRealTimeStylus, are initialized, associated with the form, and enabled.

Imports Microsoft.StylusInput
' ...
Private theRealTimeStylus As RealTimeStylus
Private theDynamicRenderer As DynamicRenderer

' ...
Private Sub InkCollector_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
    theDynamicRenderer = New DynamicRenderer(Me)
    theRealTimeStylus = New RealTimeStylus(Me, True)

    ' Add the dynamic renderer to the synchronous plugin notification chain.
    ' Synchronous notifications occur on the pen thread.
    theRealTimeStylus.SyncPluginCollection.Add(theDynamicRenderer)

    ' Add the form to the asynchronous plugin notification chain.  This plugin
    ' will be used to collect stylus data into an ink object.  Asynchronous
    ' notifications occur on the UI thread.
    theRealTimeStylus.AsyncPluginCollection.Add(Me)

    ' Enable the real time stylus and the dynamic renderer
    theRealTimeStylus.Enabled = True
    theDynamicRenderer.Enabled = True
End Sub