次の方法で共有


InkEditRecognitionEventHandler デリゲート

InkEdit コントロールの Recognition イベントを処理するメソッドを表します。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
Public Delegate Sub InkEditRecognitionEventHandler ( _
    sender As Object, _
    e As InkEditRecognitionEventArgs _
)
'使用
Dim instance As New InkEditRecognitionEventHandler(AddressOf HandlerMethod)
public delegate void InkEditRecognitionEventHandler(
    Object sender,
    InkEditRecognitionEventArgs e
)
public delegate void InkEditRecognitionEventHandler(
    Object^ sender, 
    InkEditRecognitionEventArgs^ e
)
/** @delegate */
public delegate void InkEditRecognitionEventHandler(
    Object sender,
    InkEditRecognitionEventArgs e
)
JScript では、デリゲートは使用できません。

パラメータ

  • sender
    型 : System.Object
    ソース InkEdit がこのイベントをコントロールします。

解説

InkEditRecognitionEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを指定します。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。

この例では、Recognition イベントを使用して、RecognitionResult オブジェクトを永続化します。まず、SetResultOnStrokes メソッドを呼び出すことにより、RecognitionResult オブジェクトが、関連付けられている Strokes コレクションにアタッチされます。その後で、Strokes が、関連付けられている Ink オブジェクトの CustomStrokes プロパティに追加されます。

Private Sub mInkEdit_Recognition(ByVal sender As Object, ByVal e As InkEditRecognitionEventArgs)
    Dim R As RecognitionResult = e.RecognitionResult
    R.SetResultOnStrokes()
    ' add these strokes to custom strokes collection
    ' using R.Strokes(0).Id as the name
    R.Strokes.Ink.CustomStrokes.Add(R.Strokes(0).Id.ToString(), R.Strokes)
End Sub
private void mInkEdit_Recognition(object sender, InkEditRecognitionEventArgs e)
{
    RecognitionResult R = e.RecognitionResult;
    R.SetResultOnStrokes();
    // add these strokes to custom strokes collection
    // using R.Strokes[0].Id as the name
    R.Strokes.Ink.CustomStrokes.Add(R.Strokes[0].Id.ToString(), R.Strokes);
}

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

Microsoft.Ink 名前空間

InkEdit.Recognize