Sdílet prostřednictvím


DynamicRenderer Constructor (IntPtr)

Initializes a new instance of the DynamicRenderer class.

Namespace:  Microsoft.StylusInput
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub New ( _
    handle As IntPtr _
)
'Usage
Dim handle As IntPtr 

Dim instance As New DynamicRenderer(handle)
public DynamicRenderer(
    IntPtr handle
)
public:
DynamicRenderer(
    IntPtr handle
)
public function DynamicRenderer(
    handle : IntPtr
)

Parameters

  • handle
    Type: System.IntPtr

    The control on which the tablet pen data is displayed.

Remarks

Although you typically initialize the DynamicRenderer and RealTimeStylus objects with the same Control or window handle, it is possible to initialize them with different objects. An example of this is when you want to render the ink in a different window than where the stroke packet are generated.

Examples

This C# example shows the event handler for the Load event for a form that implements the IStylusAsyncPlugin interface. A new instance of a DynamicRenderer object, theDynamicRenderer, and a RealTimeStylus object, 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(Handle);
    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;  
}

This Microsoft Visual Basic .NET example shows the event handler for the Load event for a form that implements the IStylusAsyncPlugin interface. A new instance of a DynamicRenderer object, theDynamicRenderer, and a RealTimeStylus object, 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(Handle)
    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

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

DynamicRenderer Class

DynamicRenderer Members

DynamicRenderer Overload

Microsoft.StylusInput Namespace

IStylusAsyncPlugin