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 function EndInkInput()
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.
Note
In Windows Vista and later releases, this method is deprecated for recognizers of western languages.
Examples
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 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0