Поделиться через


InkEdit.Recognition - событие

Обновлен: Ноябрь 2007

Occurs when the InkEdit control gets recognition results.

Пространство имен:  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 не поддерживает события.

Заметки

The event handler receives an argument of type InkEditRecognitionEventArgs that contains data about this event.

When you create an InkEditRecognitionEventHandler delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

The InkEdit control gets recognition results in one of two ways:

  • Manually, from a call to the InkEdit.Recognize method.

  • Automatically, after the recognition timeout fires.

Примеры

In this example, the Recognition event is used to persist the RecognitionResult object. First, the RecognitionResult object is attached to the associated Strokes collection by calling the SetResultOnStrokes method. Then the Strokes are added to the CustomStrokes property of the associated Ink object.

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

См. также

Ссылки

InkEdit Класс

InkEdit - члены

Microsoft.Ink - пространство имен

InkEditRecognitionEventArgs

InkEdit.RecoTimeout

InkEdit.Recognize

RecognitionResult.TopString

RecognitionResult.ModifyTopAlternate