Assembly: Microsoft.Ink (in microsoft.ink.dll)
To avoid a memory leak you must explicitly call the Dispose method on any RecognizerContext collection to which an event handler has been attached before the collection goes out of scope.
There are two types of recognition: background (asynchronous) or foreground (synchronous). Background recognition is started by a call to the BackgroundRecognize or BackgroundRecognizeWithAlternates methods, occurs on a background thread, and reports results to the application through an event mechanism. Foreground recognition does not return until all recognition is completed, thus making recognition results available to the calling thread without listening for the recognition event.
Ink is processed continuously in the background. If a Stroke is added to the Strokes collection to which the RecognizerContext refers, then the Stroke is then recognized immediately. See remarks in the EndInkInput method topic for more details.
All recognition occurs through a recognizer context. The context defines the settings for a single recognition session. It receives the ink that must be recognized and defines the constraints on the ink input and on the recognition output. The constraints that can be set on the context include the language, the dictionary, and grammar that is being used.
Setting properties other than the Strokes or CharacterAutoCompletion properties succeeds only if the Strokes collection is a null reference (Nothing in Visual Basic). You must set the other properties before you attach the Strokes collection to the RecognizerContext, or you must set the Strokes collection to a null reference (Nothing in Visual Basic) and then set the other properties. If you set the Strokes collection to a null reference (Nothing in Visual Basic) and then set the other properties, you may have to reattach the Strokes collection. This is because the recognition starts right after you assign the Strokes to the RecognizerContext. When a call is made to Recognize or BackgroundRecognize, call results might be already available.
To improve your application's performance, manually dispose of a RecognizerContext object when it is no longer needed.
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 EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.