다음을 통해 공유


InkRecognizer 클래스

업데이트: 2007년 11월

InkAnalyzer에서 사용되는 필기 인식기에 대한 액세스를 제공합니다.

네임스페이스:  System.Windows.Ink
어셈블리:  IAWinFX(IAWinFX.dll)

구문

‘선언
Public Class InkRecognizer _
    Implements IDisposable
‘사용 방법
Dim instance As InkRecognizer
public class InkRecognizer : IDisposable
public ref class InkRecognizer : IDisposable
public class InkRecognizer implements IDisposable
public class InkRecognizer implements IDisposable

설명

인식기에는 인식을 수행하는 데 사용되는 구체적인 특성과 속성이 있습니다. 인식을 수행하려면 먼저 인식기의 속성을 확인해야 합니다. 인식기에서 지원하는 속성 형식에 따라 인식기에서 수행할 수 있는 인식 형식이 결정됩니다. 예를 들어 인식기에서 흘림체 필기를 지원하지 않는 경우 사용자가 흘림체로 쓰면 정확하지 않은 결과가 반환됩니다.

인식기에는 필기에 관련된 여러 가지 항목을 자동으로 관리하는 기본 제공 기능도 있습니다. 예를 들어 스트로크를 그리는 줄의 단위를 결정합니다. 스트로크의 줄 번호를 반환할 수 있지만 기본 제공 기능이 사용되므로 이러한 줄 단위가 결정되는 방식은 지정할 필요가 없습니다.

InkAnalyzer에서는 사용 가능한 인식기의 InkRecognizerCollection을 유지 관리합니다. 이 컬렉션에 액세스하려면 InkAnalyzerGetInkRecognizersByPriority 메서드를 사용합니다.

예제

다음 예제에서는 문자열을 반환하는 메서드를 정의합니다. 지정된 InkRecognizer에 대한 정보가 들어 있는 문자열입니다. 리플렉션을 사용하여 InkRecognizer의 기능에 대한 정보를 반환하는 도우미 메서드인 ListCapabilities는 이 예제에 나와 있지 않습니다.

' <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();
}

상속 계층 구조

System.Object
  System.Windows.Ink.InkRecognizer

스레드로부터의 안전성

이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

InkRecognizer 멤버

System.Windows.Ink 네임스페이스

System.Windows.Ink.InkRecognizerCollection

System.Windows.Ink.InkAnalyzer

System.Windows.Ink.AnalysisHintNode