This documentation is archived and is not being maintained.

InkRecognizer Class

Provides access to handwriting recognizers used by the InkAnalyzer.

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)
XML Namespace:

public class InkRecognizer : IDisposable
public class InkRecognizer implements IDisposable
public class InkRecognizer implements IDisposable
Not applicable.

A recognizer has specific attributes and properties that allow it to perform recognition. The properties of a recognizer must be determined before recognition can occur. The types of properties that a recognizer supports, determine the types of recognition that it can perform. For instance, if a recognizer does not support cursive handwriting, it returns inaccurate results when a user writes in cursive.

A recognizer also has built-in functionality that automatically manages many aspects of handwriting. For instance, it determines the metrics for the lines on which strokes are drawn. You can return the line number of a stroke, but because of the built-in functionality, you do not need to specify how those line metrics are determined.

The InkAnalyzer maintains a InkRecognizerCollection of available recognizers. To access this collection, use the GetInkRecognizersByPriority method of the InkAnalyzer.

The following example defines a method that returns a string. The string contains information about a specified InkRecognizer. Not shown in this example is the helper method, ListCapabilities, which uses reflection to return information about the capabilities of the InkRecognizer.

/// <summary>
/// Generates a string containing information about the specified InkRecognizer.
/// </summary>
/// <param name="theInkRecognizer">
/// The InkRecognizer from which to gather the information.
/// </param>
/// <returns>
/// A string containing information about the specified InkRecognizer.
/// </returns>
private string GetInkRecognizerData(
    InkRecognizer theInkRecognizer)
    // Create a StringBuilder in which to collect the information.
    System.Text.StringBuilder result = new System.Text.StringBuilder();

    // Add the name of the recognizer.
        "Name: {0}", theInkRecognizer.Name));

    // Add the GUID of the recognizer.
        "   Guid: {0}", theInkRecognizer.Guid));

    // Add the vendor of the recognizer.
        "   Vendor: {0}", theInkRecognizer.Vendor));

    // Add the languages the recognizer supports.
    result.AppendLine("   Supports the following languages:");
    if (0 == theInkRecognizer.GetLanguages().Length)
        result.AppendLine("      No languages supported.");
        foreach (int lcid in theInkRecognizer.GetLanguages())
            System.Globalization.CultureInfo theCultureInfo =
                new System.Globalization.CultureInfo(lcid);
                "      0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName));

    // Add the capabilities of the recognizer.
        "   Capabilities: 0x{0:x}", theInkRecognizer.Capabilities));

    // List each capability separately, using a helper method.

    result.AppendLine(string.Format("      {0} properties supported.", 

    return result.ToString();


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.

.NET Framework

Supported in: 3.0