InkEdit コントロールが認識結果を取得したときに発生します。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink (Microsoft.Ink.dll 内)
構文
'宣言
Public Event Recognition As InkEditRecognitionEventHandler
'使用
Dim instance As InkEdit
Dim handler As InkEditRecognitionEventHandler
AddHandler instance.Recognition, handler
public event InkEditRecognitionEventHandler Recognition
public:
event InkEditRecognitionEventHandler^ Recognition {
void add (InkEditRecognitionEventHandler^ value);
void remove (InkEditRecognitionEventHandler^ value);
}
/** @event */
public void add_Recognition (InkEditRecognitionEventHandler value)
/** @event */
public void remove_Recognition (InkEditRecognitionEventHandler value)
JScript では、イベントは使用できません。
解説
イベント ハンドラは、このイベントについてのデータを格納している InkEditRecognitionEventArgs 型の引数を受け取ります。
InkEditRecognitionEventHandler デリゲートを作成する場合は、イベントを処理するメソッドを指定します。イベントをイベント ハンドラに関連付けるには、デリゲートのインスタンスをイベントに追加します。デリゲートを削除しない限り、そのイベントが発生すると常にイベント ハンドラが呼び出されます。
InkEdit コントロールは、次の 2 つの方法のいずれかで認識結果を取得します。
InkEdit.Recognize の呼び出しから手動で取得する。
認識タイムアウトの発生後に自動的に取得する。
例
この例では、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