다음을 통해 공유


RecognitionAlternate.GetStrokesFromTextRange 메서드

업데이트: 2007년 11월

대체 항목 내의 지정된 문자 범위가 들어 있는 인식 세그먼트의 가장 작은 집합에 해당하는 Strokes 컬렉션을 반환합니다.

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

구문

‘선언
Public Function GetStrokesFromTextRange ( _
    ByRef selectionStart As Integer, _
    ByRef selectionLength As Integer _
) As Strokes
‘사용 방법
Dim instance As RecognitionAlternate
Dim selectionStart As Integer
Dim selectionLength As Integer
Dim returnValue As Strokes

returnValue = instance.GetStrokesFromTextRange(selectionStart, _
    selectionLength)
public Strokes GetStrokesFromTextRange(
    ref int selectionStart,
    ref int selectionLength
)
public:
Strokes^ GetStrokesFromTextRange(
    int% selectionStart, 
    int% selectionLength
)
public Strokes GetStrokesFromTextRange(
    /** @ref */int selectionStart,
    /** @ref */int selectionLength
)
public function GetStrokesFromTextRange(
    selectionStart : int, 
    selectionLength : int
) : Strokes

매개 변수

  • selectionStart
    형식: System.Int32%
    이 대체 항목 내에서 문자 범위의 시작 부분입니다.
  • selectionLength
    형식: System.Int32%
    대체 항목 내에서 문자 범위의 길이입니다. 이 매개 변수는 0보다 커야 하며, 입력 선택 영역을 포함하는 하나 이상의 세그먼트로 구성된 가장 작은 집합의 길이로 조정됩니다.

반환 값

형식: Microsoft.Ink.Strokes
대체 항목 내의 지정된 문자 범위가 들어 있는 인식 세그먼트의 가장 작은 집합에 해당하는 Strokes 컬렉션을 반환합니다.

설명

selectionStart 위치에 있는 문자는 인식된 텍스트의 범위에 포함됩니다. 이 매개 변수는 입력 선택 영역을 포함하는 하나 이상의 세그먼트로 구성된 가장 작은 인식된 집합의 시작 부분으로 조정됩니다. selectionStart 매개 변수는 인식 대체 항목의 텍스트에 있는 문자에 대한 인덱스(0부터 시작)입니다.

이미 분석되었고 최적 대체 항목이 "how are you"인 Strokes 컬렉션이 있다고 가정해 봅니다. 이 메서드에 전달된 매개 변수는 이 문자열 결과 내의 일부 범위 또는 전체입니다. 이 대체 항목에는 각 단어와 각 공백에 하나씩 다섯 개의 세그먼트가 들어 있습니다. 반환되는 스트로크는 모든 입력 범위를 포함하는 가장 작은 세그먼트 집합에 해당합니다. selectionStart 매개 변수를 0으로, selectionLength 매개 변수를 5로 지정하여 결과 문자열의 "how a"에 해당하는 범위를 만들면 "how are" 세그먼트를 구성하는 모든 인식된 스트로크가 반환됩니다. 이는 입력 범위를 포함하는 가장 작은 세그먼트 집합입니다.

단어 기반 인식기와 문자 기반 인식기 모두에서 공백은 문자로 간주됩니다. 입력 선택 영역이 공백 문자에 해당하면 이 메서드는 빈 Strokes 컬렉션을 반환합니다.

예제

이 C# 예제에서는 텍스트 범위를 포함하는 RecognitionAlternate 개체의 가장 작은 집합에 연결된 Strokes 컬렉션인 altStrokes를 찾습니다.

[C#]

theTextBox.Text = theRecognitionResult.TopString;
//... Assume the user has selected a range within theTextBox.
int selStart = theTextBox.SelectionStart;
int selLength = theTextBox.SelectionLength;
Strokes altStrokes;
altStrokes = theRecognitionResult.TopAlternate.GetStrokesFromTextRange(
    ref selStart, ref selLength);

이 Microsoft® Visual Basic® .NET 예제에서는 텍스트 범위를 포함하는 RecognitionAlternate 개체의 가장 작은 집합에 연결된 Strokes 컬렉션인 altStrokes를 찾습니다.

[Visual Basic]

theTextBox.Text = theRecognitionResult.TopString
'... Assume the user has selected a range within theTextBox.
Dim selStart As Integer = theTextBox.SelectionStart
Dim selLength As Integer = theTextBox.SelectionLength
Dim altStrokes As Strokes
altStrokes = theRecognitionResult.TopAlternate.GetStrokesFromTextRange( _
    selStart, selLength)

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

RecognitionAlternate 클래스

RecognitionAlternate 멤버

Microsoft.Ink 네임스페이스

RecognitionAlternate.GetStrokesFromStrokeRanges

RecognitionAlternate.GetTextRangeFromStrokes

Strokes