次の方法で共有


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 は、StrokesRootNode プロパティの SubNodes コレクション内の UnclassifiedInkNode に追加します。Strokes コレクション strokesToAdd 内の各ストロークにアクティブな入力スレッドのロケール識別子を割り当て、同じロケール識別子のストロークを格納する最初の UnclassifiedInkNode に追加します。そのような UnclassifiedInkNode が存在しない場合、新しい UnclassifiedInkNode が作成され、strokeToAdd が新しい UnclassifiedInkNode に追加されます。

このメソッドは、DirtyRegion を、領域の現在の値と追加されたストロークの境界ボックスの結合に拡張します。

いずれかのストロークが既に InkAnalyzer に結合されている場合、InkAnalyzer は例外をスローします。

この例では次の処理を行います。

  • 新しい Microsoft.Ink.Ink オブジェクト theInk を初期化します。

  • Ink.InkAdded イベント ハンドラ theInk_InkAdded を theInk に結合します。

  • theInk からストローク データを分析できる新しい InkAnalyzer、theInkAnalyzer を初期化します。

' 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