Compartir a través de


InkRecognizer (Clase)

Actualización: noviembre 2007

Proporciona acceso a los reconocedores de escritura a mano utilizados por InkAnalyzer.

Espacio de nombres:  System.Windows.Ink
Ensamblado:  IAWinFX (en IAWinFX.dll)

Sintaxis

'Declaración
Public Class InkRecognizer _
    Implements IDisposable
'Uso
Dim instance As InkRecognizer
public class InkRecognizer : IDisposable
public ref class InkRecognizer : IDisposable
public class InkRecognizer implements IDisposable
public class InkRecognizer implements IDisposable

Comentarios

Un reconocedor tiene atributos y propiedades específicos que le permiten realizar el reconocimiento. Las propiedades de un reconocedor deben determinarse antes de que pueda realizarse el reconocimiento. Los tipos de propiedades compatibles con un reconocedor determinan los tipos de reconocimiento que puede realizar. Por ejemplo, si un reconocedor no admite la escritura a mano en cursiva, devolverá resultados inexactos cuando el usuario escriba en cursiva.

Un reconocedor tiene también una función integrada que administra de forma automática numerosos aspectos de la escritura a mano. Por ejemplo, determina la métrica de las líneas en las que se dibujan los trazos. Se puede devolver el número de línea de un trazo, pero, debido a la funcionalidad integrada, no es necesario especificar cómo se determina la métrica de esas líneas.

El objeto InkAnalyzer mantiene un objeto InkRecognizerCollection de reconocedores disponibles. Para tener acceso a esta colección, use el método GetInkRecognizersByPriority de InkAnalyzer.

Ejemplos

En el ejemplo siguiente se define un método que devuelve una cadena. La cadena contiene información sobre un objeto InkRecognizer especificado. En este ejemplo no se muestra el método auxiliar, ListCapabilities, que utiliza la reflexión para devolver información sobre la funcionalidad de 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 Function GetInkRecognizerData(ByVal theInkRecognizer As InkRecognizer) As String
    ' Create a StringBuilder in which to collect the information.
    Dim result As New System.Text.StringBuilder()

    ' Add the name of the recognizer.
    result.AppendLine(String.Format("Name: {0}", theInkRecognizer.Name))

    ' Add the GUID of the recognizer.
    result.AppendLine(String.Format("   Guid: {0}", theInkRecognizer.Guid))

    ' Add the vendor of the recognizer.
    result.AppendLine(String.Format("   Vendor: {0}", theInkRecognizer.Vendor))

    ' Add the languages the recognizer supports.
    result.AppendLine("   Supports the following languages:")
    If 0 = theInkRecognizer.GetLanguages().Length Then
        result.AppendLine("      No languages supported.")
    Else
        Dim lcid As Integer
        For Each lcid In theInkRecognizer.GetLanguages()
            Dim theCultureInfo As New System.Globalization.CultureInfo(lcid)
            result.AppendLine(String.Format("      0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName))
        Next lcid
    End If

    ' Add the capabilities of the recognizer.
    result.AppendLine(String.Format("   Capabilities: 0x{0:x}", theInkRecognizer.Capabilities))

    ' List each capability separately, using a helper method.
    result.Append(Me.ListCapabilities(theInkRecognizer.Capabilities))

    result.AppendLine(String.Format("      {0} properties supported.", _
        theInkRecognizer.GetSupportedProperties().Length.ToString()))

    Return result.ToString()

End Function 'GetInkRecognizerData

/// <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.
    result.AppendLine(string.Format(
        "Name: {0}", theInkRecognizer.Name));

    // Add the GUID of the recognizer.
    result.AppendLine(string.Format(
        "   Guid: {0}", theInkRecognizer.Guid));

    // Add the vendor of the recognizer.
    result.AppendLine(string.Format(
        "   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.");
    }
    else
    {
        foreach (int lcid in theInkRecognizer.GetLanguages())
        {
            System.Globalization.CultureInfo theCultureInfo =
                new System.Globalization.CultureInfo(lcid);
            result.AppendLine(string.Format(
                "      0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName));
        }
    }

    // Add the capabilities of the recognizer.
    result.AppendLine(string.Format(
        "   Capabilities: 0x{0:x}", theInkRecognizer.Capabilities));

    // List each capability separately, using a helper method.
    result.Append(this.ListCapabilities(theInkRecognizer.Capabilities));

    result.AppendLine(string.Format("      {0} properties supported.", 
        theInkRecognizer.GetSupportedProperties().Length.ToString()));

    return result.ToString();
}

Jerarquía de herencia

System.Object
  System.Windows.Ink.InkRecognizer

Seguridad para subprocesos

Todos los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas

Windows Vista

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

InkRecognizer (Miembros)

System.Windows.Ink (Espacio de nombres)

System.Windows.Ink.InkRecognizerCollection

System.Windows.Ink.InkAnalyzer

System.Windows.Ink.AnalysisHintNode