共用方式為


InkAnalyzer.AddStrokes 方法 (Strokes)

將筆劃集合加入至 InkAnalyzer,並且將使用中輸入執行緒的地區設定識別項指派給每個筆劃。

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

語法

'宣告
Public Function AddStrokes ( _
    strokesToAdd As Strokes _
) As ContextNode
'用途
Dim instance As InkAnalyzer
Dim strokesToAdd As Strokes
Dim returnValue As ContextNode

returnValue = instance.AddStrokes(strokesToAdd)
public ContextNode AddStrokes(
    Strokes strokesToAdd
)
public:
ContextNode^ AddStrokes(
    Strokes^ strokesToAdd
)
public ContextNode AddStrokes(
    Strokes strokesToAdd
)
public function AddStrokes(
    strokesToAdd : Strokes
) : ContextNode

參數

傳回值

型別:Microsoft.Ink.ContextNode
其中加入 strokesToAdd 的 ContextNode

備註

InkAnalyzer 會將 Strokes 加入至 RootNode 屬性之 SubNodes 集合中的 UnclassifiedInkNodeStrokes (strokesToAdd) 中的每個筆劃都會收到指派的使用中輸入執行緒的地區設定識別項,並且加入至包含相同地區設定識別項之筆劃的 UnclassifiedInkNode。如果沒有這類 UnclassifiedInkNode,則會建立新的 UnclassifiedInkNode 並會將 strokeToAdd 加入至新 UnclassifiedInkNode

這個方法會將 DirtyRegion 擴充至區域目前值和所加入筆劃週框的聯集。

如果任何筆劃已附加至 InkAnalyzer,則 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 成員

AddStrokes 多載

Microsoft.Ink 命名空間

InkAnalyzer.AddStroke

InkAnalyzer.RemoveStroke

InkAnalyzer.RemoveStrokes