Condividi tramite


Classe InkRecognizerBase

Aggiornamento: novembre 2007

Fornisce accesso ai sistemi di riconoscimento grafia da utilizzare con l'analisi dell'input penna.

Spazio dei nomi:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Sintassi

'Dichiarazione
Public Class InkRecognizerBase _
    Implements IDisposable
'Utilizzo
Dim instance As InkRecognizerBase
public class InkRecognizerBase : IDisposable
public ref class InkRecognizerBase : IDisposable
public class InkRecognizerBase implements IDisposable
public class InkRecognizerBase implements IDisposable

Note

Un sistema di riconoscimento dispone di attributi e proprietà specifici per l'esecuzione del riconoscimento. Prima di procedere con il riconoscimento, è necessario definirne le proprietà. I tipi di proprietà supportati da un sistema di riconoscimento determinano i tipi di riconoscimento eseguibili. Ad esempio, se un sistema di riconoscimento non supporta la grafia corsiva, restituisce risultati non accurati quando un utente scrive in corsivo.

Un sistema di riconoscimento dispone inoltre di funzionalità incorporate per la gestione automatica di molti aspetti della grafia. Ad esempio, determina la metrica per le righe su cui sono disegnati i tratti. È possibile restituire il numero di righe di un tratto, tuttavia, grazie alla funzionalità incorporata del sistema di riconoscimento non è necessario specificare il modo in cui viene determinata la metrica delle righe.

InkAnalyzerBase gestisce un insieme InkRecognizerBaseCollection di sistemi di riconoscimento disponibili. Per accedere a questo insieme, utilizzare il metodo GetInkRecognizersByPriority di InkAnalyzerBase.

Esempi

Nell'esempio seguente viene definito un metodo che restituisce una stringa contenente informazioni su un oggetto InkRecognizerBase specificato. In questo esempio non vengono illustrati i metodi di supporto ListCapabilities e GetPropertyName che utilizzano la riflessione per restituire informazioni su funzionalità e proprietà specifiche di InkRecognizerBase.

''' <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 System.Windows.Ink.AnalysisCore.InkRecognizerBase) 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
        For Each lcid As Integer In theInkRecognizer.GetLanguages()
            Dim theCultureInfo As New System.Globalization.CultureInfo(lcid)
            result.AppendLine(String.Format( _
                "      0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName))
        Next
    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))

    ' Add the properties the recognizer supports.
    result.AppendLine("   Supports the following properties:")
    If (0 = theInkRecognizer.GetSupportedProperties().Length) Then
        result.AppendLine("      No properties supported.")
    Else
        For Each theGuid As System.Guid In theInkRecognizer.GetSupportedProperties()
            ' Use the helper method to get the name of the property.
            result.AppendLine("      " + Me.GetPropertyName(theGuid))
        Next
    End If

    Return result.ToString()
End Function
        /// <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(
            System.Windows.Ink.AnalysisCore.InkRecognizerBase 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));

            // Add the properties the recognizer supports.
            result.AppendLine("   Supports the following properties:");
            if (0 == theInkRecognizer.GetSupportedProperties().Length)
            {
                result.AppendLine("      No properties supported.");
            }
            else
            {
                foreach (System.Guid theGuid in theInkRecognizer.GetSupportedProperties())
                {
                    // Use the helper method to get the name of the property.
                    result.AppendLine("      " + this.GetPropertyName(theGuid));
                }
            }

            return result.ToString();
        }

Gerarchia di ereditarietà

System.Object
  System.Windows.Ink.AnalysisCore.InkRecognizerBase

Codice thread safe

Qualsiasi membro static (Shared in Visual Basic) pubblico di questo tipo è thread-safe. I membri di istanza non sono garantiti come thread-safe.

Piattaforme

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

Membri InkRecognizerBase

Spazio dei nomi System.Windows.Ink.AnalysisCore

System.Windows.Ink.AnalysisCore.InkRecognizerBaseCollection

Microsoft.Ink.InkAnalyzer

System.Windows.Ink.AnalysisHintNode

System.Windows.Ink.AnalysisCore.PropertyGuidsForAnalysisHintsBase