다음을 통해 공유


RecognitionResult.Strokes 속성

업데이트: 2007년 11월

인식기에서 RecognitionResult 개체를 생성하는 데 사용한 Strokes 컬렉션을 가져옵니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public ReadOnly Property Strokes As Strokes
‘사용 방법
Dim instance As RecognitionResult
Dim value As Strokes

value = instance.Strokes
public Strokes Strokes { get; }
public:
property Strokes^ Strokes {
    Strokes^ get ();
}
/** @property */
public Strokes get_Strokes()
public function get Strokes () : Strokes

속성 값

형식: Microsoft.Ink.Strokes
인식기에서 RecognitionResult 개체를 생성하는 데 사용한 Strokes 컬렉션입니다.

설명

기본적으로 RecognitionResult 개체는 Strokes 컬렉션에 연결되지 않습니다. Strokes 컬렉션에 결과를 할당하려면 RecognitionResult 개체의 SetResultOnStrokes 메서드를 호출해야 합니다.

예제

이 예제에서는 메뉴 항목이나 단추를 클릭하는 등의 사용자 동작에 응답하여 동기적 인식을 처리합니다. 우선 InkOverlay 개체에 연결된 Strokes 컬렉션을 사용하여 RecognizerContext 개체의 Strokes 컬렉션을 할당하고 스트로크 개수를 확인합니다. Strokes 컬렉션에 Stroke 개체가 최소한 하나 이상 들어 있으면 Recognize 메서드를 호출하여 인식 프로세스를 시작합니다. 인식에 성공했으며 TopConfidence(지원되는 경우)가 RecognitionConfidencePoor가 아닌 Intermediate 또는 Strong이면 목록 상자에 TopString을 추가하여 표시합니다.

' assign strokes collection from the collected strokes
Me.mRecognizerContext.Strokes = Me.mInkOverlay.Ink.Strokes
' check stroke count. Recognize() will throw exception if no strokes
If (Me.mRecognizerContext.Strokes.Count > 0) Then
    Dim status As RecognitionStatus
    ' perform the recognition
    Dim rResult As RecognitionResult = Me.mRecognizerContext.Recognize(status)
    ' see if the recognizer used supports confidence levels
    Dim rSupportsConfidence As Boolean = RecognizerSupportsConfidence(mRecognizerContext.Recognizer)
    ' check status and TopConfidence (if supported)
    If (RecognitionStatus.NoError = status And _
        ((rSupportsConfidence And _
         rResult.TopConfidence <> RecognitionConfidence.Poor) Or _
         Not rSupportsConfidence)) Then
        listBoxRecognitionResults.Items.Add(rResult.TopString)
    End If
End If
// assign strokes collection from the collected strokes
this.mRecognizerContext.Strokes = this.mInkOverlay.Ink.Strokes;
// check stroke count. Recognize() will throw exception if no strokes
if (this.mRecognizerContext.Strokes.Count > 0)
{
    RecognitionStatus status;
    // perform the recognition
    RecognitionResult rResult = this.mRecognizerContext.Recognize(out status);
    // see if the recognizer used supports confidence levels
    bool rSupportsConfidence = RecognizerSupportsConfidence(mRecognizerContext.Recognizer);
    // check status and TopConfidence (if supported)
    if (RecognitionStatus.NoError == status &&
        ((rSupportsConfidence &&
         rResult.TopConfidence != RecognitionConfidence.Poor) ||
         !rSupportsConfidence))
    {
        listBoxRecognitionResults.Items.Add(rResult.TopString);
    }
}

다음 예제에서는 Recognizer에서 신뢰 수준을 지원하는지 확인하는 데 사용되는 도우미 메서드를 보여 줍니다.

Private Function RecognizerSupportsConfidence(ByVal pRecognizer As Recognizer) As Boolean
    For Each G As Guid In pRecognizer.SupportedProperties
        If G = RecognitionProperty.ConfidenceLevel Then
            Return True
        End If
    Next
    Return False
End Function
private bool RecognizerSupportsConfidence(Recognizer pRecognizer)
{
    foreach (Guid G in pRecognizer.SupportedProperties)
    {
        if (G == RecognitionProperty.ConfidenceLevel)
        {
            return true;
        }
    }
    return false;
}

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

RecognitionResult 클래스

RecognitionResult 멤버

Microsoft.Ink 네임스페이스

Strokes