次の方法で共有


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
)

パラメータ

  • synchronizingObject
    型 : System.ComponentModel.ISynchronizeInvoke
    System.ComponentModel.ISynchronizeInvoke インターフェイスを実装する、InkAnalyzer に関連付けられたコントロール。

解説

InkAnalyzer は、1 つの Ink オブジェクトだけからストローク データを分析できます。インク アナライザを初期化した後にはこの関連付けを変更できません。

synchronizingObject に null 値を渡すと、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 メンバ

Microsoft.Ink 名前空間

Microsoft.Ink.Ink