Assembly: IAWinFX (in IAWinFX.dll)
The simplest way to create a custom recognizer is to use InkAnalyzer.CreateCustomRecognizer to create the recognizer and to use InkAnalyzerAddStrokesToCustomRecognizer(StrokeCollection, ContextNode) to assign strokes to it. If any stroke that you add is already assigned to any node in the InkAnalyzer context tree, including an UnclassifiedInkNode, an ArgumentException is thrown. To avoid this, use InkAnalyzer.RemoveStroke or InkAnalyzer.RemoveStrokes to remove those strokes from the InkAnalyzer context tree before adding them to the custom recognizer.
The following example takes a Guid for a custom recognizer named customRecognizerId, and creates a with it for an InkAnalyzer named theInkAnalyzer. Strokes are then added from a StrokeCollection, strokesForCustomAnalysis. Then Analyze is called and the recognized string is put into a TextBox, theResultsTextBox.
CustomRecognizerNode customRecognizer = theInkAnalyzer.CreateCustomRecognizer(customRecognizerId); theInkAnalyzer.AddStrokesToCustomRecognizer(strokesForCustomAnalysis, customRecognizer); AnalysisStatus theStatus = theInkAnalyzer.Analyze(); theResultsTextBox.Text = customRecognizer.GetRecognizedString();
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
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.