共用方式為


InkAnalyzer 建構函式

初始化與指定的 Microsoft.Ink.Ink 物件相關聯之 InkAnalyzer 類別的新執行個體。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink.Analysis (在 Microsoft.Ink.Analysis.dll 中)

語法

'宣告
Public Sub New ( _
    ink As Ink, _
    synchronizingObject As ISynchronizeInvoke _
)
'用途
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
)

參數

備註

InkAnalyzer 只能從一個 Ink 物件分析筆劃資料。筆墨分析器初始化之後,就無法變更這個關聯。

如果您傳遞 null 值給 synchronizingObject,則無法保證在處理 InkAnalyzer 引發的事件時同步處理執行緒。

範例

這個範例會執行下列操作:

  • 初始化新的 Microsoft.Ink.Ink 物件 (theInk)。

  • Ink.InkAdded 事件處理常式 (theInk_InkAdded) 附加至 theInk。

  • 初始化名為 theInkAnalyzer 的新 InkAnalyzer,分析來自 theInk 的筆劃資料。

' 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);

在這個範例中,theInk_InkAdded 事件處理常式接著會取得已加入至 theInk 的筆劃,並將其加入至 theInkAnalyzer。

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

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

InkAnalyzer 類別

InkAnalyzer 成員

Microsoft.Ink 命名空間

Microsoft.Ink.Ink