Share via


RecognizerContext.EndInkInput Method

Ends ink input to the RecognizerContext object.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Sub EndInkInput
'Usage
Dim instance As RecognizerContext

instance.EndInkInput
public void EndInkInput ()
public:
void EndInkInput ()
public void EndInkInput ()
public function EndInkInput ()
Not applicable.

Remarks

After you call this method, you cannot add Stroke objects to the RecognizerContext object.

Partial recognition is the ability of the recognizer to return results even if the application has not called the EndInkInput method, which signals to the application that all the ink has been entered. Partial recognition occurs only if the recognizer can determine that ink has been entered before a call to EndInkInput, and not all recognizers support this feature. Recognizers that do not support partial recognition do not return any result until EndInkInput is called.

Incremental recognition is the ability of the recognizer to process only a small part of the ink that has been passed to it and return a result. For example, consider that an application contains five lines of ink and uses a recognizer of Latin script. The recognizer can process only one line at a time and return a result. This process is used in the idle loop of the background processing thread.

If the recognizer supports partial recognition, it can return a result even if the EndInkInput method has not been called.

Note

Results derived from partial recognition may be different from the results if you call EndInkInput. By using partial recognition you do not require the recognizer to return results for all of the ink. Losing the surrounding context of some ink may adversely affect recognition.

Example

This C# example shows an event handler for a button control's Click event, buttonSubmit_Click, that recognizes the valid ink in the Strokes collection assigned to the RecognizerContext, theRecognizerContext, (declared in a containing scope) and displays it in a text box if no errors occur.

private void buttonSubmit_Click(object sender, System.EventArgs e)
{
    theRecognizerContext.EndInkInput();
    RecognitionStatus theRecognitionStatus;
    theRecognitionResult = theRecognizerContext.Recognize(out theRecognitionStatus);
    if (RecognitionStatus.NoError == theRecognitionStatus)
        theTextBox.Text = theRecognitionResult.TopString;
    else
        // Handle the error cases here...
        theTextBox.Text = "";
}

This Microsoft Visual BasicĀ® .NET example shows an event handler for a button control's Click event, buttonSubmit_Click, that recognizes the valid ink in the Strokes collection assigned to the RecognizerContext, theRecognizerContext, (declared in a containing scope) and displays it in a text box if no errors occur.

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
    theRecognizerContext.EndInkInput()
    Dim theRecognitionStatus As RecognitionStatus
    theRecognitionResult = theRecognizerContext.Recognize(theRecognitionStatus)
    If RecognitionStatus.NoError = theRecognitionStatus Then
        RichTextBox1.Text = theRecognitionResult.TopString
    Else
        'Handle the error conditions here.
        RichTextBox1.Text = ""
    End If
End Sub

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

RecognizerContext Class
RecognizerContext Members
Microsoft.Ink Namespace