Freigeben über


DynamicRenderer-Konstruktor (IntPtr)

Initialisiert eine neue Instanz der DynamicRenderer-Klasse.

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 DynamicRenderer(
    IntPtr handle
)
public function DynamicRenderer(
    handle : IntPtr
)

Parameter

  • handle
    Typ: System.IntPtr
    Das Steuerelement, auf dem die Tablettstiftdaten angezeigt werden.

Hinweise

Obwohl Sie die DynamicRenderer- und RealTimeStylus-Objekte normalerweise mit demselben Control- oder Fensterhandle initialisieren, können Sie diese Objekte mit unterschiedlichen Objekten initialisieren. Ein Beispiel hierfür ist, wenn Sie die Freihandeingabe nicht im selben Fenster rendern möchten, in dem das Strichpaket generiert wurde.

Beispiele

In diesem C#-Beispiel wird der Ereignishandler für das Load-Ereignis eines Formulars veranschaulicht, das die IStylusAsyncPlugin-Schnittstelle implementiert. Eine neue Instanz eines DynamicRenderer-Objekts mit dem Namen theDynamicRenderer und ein RealTimeStylus-Objekt mit dem Namen theRealTimeStylus werden initialisiert, dem Formular zugeordnet und aktiviert.

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;  
}

In diesem Microsoft Visual Basic .NET-Beispiel wird der Ereignishandler für das Load-Ereignis für ein Formular veranschaulicht, das die IStylusAsyncPlugin-Schnittstelle implementiert. Eine neue Instanz eines DynamicRenderer-Objekts mit dem Namen theDynamicRenderer und ein RealTimeStylus-Objekt mit dem Namen theRealTimeStylus werden initialisiert, dem Formular zugeordnet und aktiviert.

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

Plattformen

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

Versionsinformationen

.NET Framework

Unterstützt in: 3.0

Siehe auch

Referenz

DynamicRenderer-Klasse

DynamicRenderer-Member

DynamicRenderer-Überladung

Microsoft.StylusInput-Namespace

IStylusAsyncPlugin