Freigeben über


InkAnalyzer-Konstruktor

Initialisiert eine neue Instanz der InkAnalyzer-Klasse, die dem angegebenen Microsoft.Ink.Ink-Objekt zugeordnet ist.

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

Syntax

'Declaration
Public Sub New ( _
    ink As Ink, _
    synchronizingObject As ISynchronizeInvoke _
)
'Usage
Dim ink As Ink
Dim synchronizingObject As ISynchronizeInvoke

Dim instance As New InkAnalyzer(ink, synchronizingObject)
public InkAnalyzer(
    Ink ink,
    ISynchronizeInvoke synchronizingObject
)
public:
InkAnalyzer(
    Ink^ ink, 
    ISynchronizeInvoke^ synchronizingObject
)
public InkAnalyzer(
    Ink ink,
    ISynchronizeInvoke synchronizingObject
)
public function InkAnalyzer(
    ink : Ink, 
    synchronizingObject : ISynchronizeInvoke
)

Parameter

  • synchronizingObject
    Typ: System.ComponentModel.ISynchronizeInvoke
    Das Steuerelement, das dem Freihandanalysemodul zugeordnet ist, das die System.ComponentModel.ISynchronizeInvoke-Schnittstelle implementiert.

Hinweise

InkAnalyzer kann lediglich Strichdaten eines Ink-Objekts analysieren. Sie können diese Zuordnung nicht ändern, nachdem das Freihandanalysemodul initialisiert wurde.

Wenn Sie einen NULL-Wert für synchronizingObject übergeben, ist die Threadsynchronisation nicht gewährleistet, wenn vom Freihandanalysemodul ausgelöste Ereignisse verarbeitet werden.

Beispiele

In diesem Beispiel wird Folgendes ausgeführt.

  • Initialisiert ein neues Microsoft.Ink.Ink-Objekt namens theInk.

  • Fügt einen Ink.InkAdded-Ereignishandler, theInk_InkAdded, an theInk an.

  • Initialisiert einen neuen InkAnalyzer, theInkAnalyzer, der Strichdaten aus theInk analysieren kann.

' Create the Ink for use with the InkCollector and attach
' event handlers.
Me.theInk = New Microsoft.Ink.Ink()
AddHandler Me.theInk.InkAdded, AddressOf theInk_InkAdded

' Create the InkAnalyzer.
Me.theInkAnalyzer = New Microsoft.Ink.InkAnalyzer(Me.theInk, Me)
// Create the Ink for use with the InkCollector and attach
// event handlers.
this.theInk = new Microsoft.Ink.Ink();
this.theInk.InkAdded +=
    new Microsoft.Ink.StrokesEventHandler(theInk_InkAdded);

// Create the InkAnalyzer.
this.theInkAnalyzer =
    new Microsoft.Ink.InkAnalyzer(this.theInk, this);

In diesem Beispiel akzeptiert der theInk_InkAdded-Ereignishandler dann die Striche, die theInk hinzugefügt wurden, und fügt sie theInkAnalyzer hinzu.

''' <summary>
''' The ink's InkAdded event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInk_InkAdded( _
    ByVal sender As Object, ByVal e As Microsoft.Ink.StrokesEventArgs)

    ' This event handler is attached to an Ink object.
    Dim theInk As Microsoft.Ink.Ink = DirectCast(sender, Microsoft.Ink.Ink)

    ' Add the new strokes to the InkAnalyzer.
    Me.theInkAnalyzer.AddStrokes(theInk.CreateStrokes(e.StrokeIds))

End Sub 'theInk_InkAdded
/// <summary>
/// The ink's InkAdded event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInk_InkAdded(object sender, Microsoft.Ink.StrokesEventArgs e)
{
    // This event handler is attached to an Ink object.
    Microsoft.Ink.Ink theInk = sender as Microsoft.Ink.Ink;

    // Add the new strokes to the InkAnalyzer.
    this.theInkAnalyzer.AddStrokes(theInk.CreateStrokes(e.StrokeIds));
}

Plattformen

Windows Vista

.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

InkAnalyzer-Klasse

InkAnalyzer-Member

Microsoft.Ink-Namespace

Microsoft.Ink.Ink