다음을 통해 공유


ParagraphNode.GetTextRangeFromNodes 메서드

업데이트: 2007년 11월

ParagraphNode의 하위 항목인 ContextNode 개체 컬렉션에 해당하는 인식된 문자열에서 텍스트 범위를 찾습니다.

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

구문

‘선언
Public Sub GetTextRangeFromNodes ( _
    subTree As ContextNodeCollection, _
    <OutAttribute> ByRef start As Integer, _
    <OutAttribute> ByRef length As Integer _
)
‘사용 방법
Dim instance As ParagraphNode
Dim subTree As ContextNodeCollection
Dim start As Integer
Dim length As Integer

instance.GetTextRangeFromNodes(subTree, _
    start, length)
public void GetTextRangeFromNodes(
    ContextNodeCollection subTree,
    out int start,
    out int length
)
public:
void GetTextRangeFromNodes(
    ContextNodeCollection^ subTree, 
    [OutAttribute] int% start, 
    [OutAttribute] int% length
)
public void GetTextRangeFromNodes(
    ContextNodeCollection subTree,
    /** @attribute OutAttribute */ /** @ref */int start,
    /** @attribute OutAttribute */ /** @ref */int length
)
public function GetTextRangeFromNodes(
    subTree : ContextNodeCollection, 
    start : int, 
    length : int
)

매개 변수

  • start
    형식: System.Int32%
    텍스트 범위의 시작 위치입니다.
  • length
    형식: System.Int32%
    텍스트 범위의 길이입니다.

설명

subTree 매개 변수에 ParagraphNode의 하위 항목이 아닌 ContextNode 개체가 들어 있으면 ArgumentException 예외가 throw됩니다.

subTree 매개 변수에 연속되지 않은 여러 ContextNode 개체가 들어 있으면 모든 ContextNode 개체를 포함하는 가장 작은 텍스트 범위가 반환됩니다.

예제

다음 예제에서는 ParagraphNode인 paragraph를 사용하여 마지막 줄을 찾습니다. 그런 다음 이 줄에 해당하는 텍스트 범위를 찾고, GetRecognizedString 값을 TextBox인 selectedResultsTextBox에 배치한 후 마지막 줄에 해당하는 텍스트를 선택합니다.

Dim nLines As Integer = paragraph.SubNodes.Count
Dim lastLine As LineNode = CType(paragraph.SubNodes(nLines - 1), LineNode)

' Create a collection to hold this line
Dim lastLineCollection As New ContextNodeCollection(theInkAnalyzer)
lastLineCollection.Add(lastLine)

' Find corresponding start and length
Dim start, length As Integer
paragraph.GetTextRangeFromNodes(lastLineCollection, start, length)

' Select this in the text box
selectedResultsTextBox.Text = paragraph.GetRecognizedString()
selectedResultsTextBox.Select(start, length)
                int nLines = paragraph.SubNodes.Count;
                LineNode lastLine = (LineNode)paragraph.SubNodes[nLines - 1];

                // Create a collection to hold this line
                ContextNodeCollection lastLineCollection = new ContextNodeCollection(theInkAnalyzer);
                lastLineCollection.Add(lastLine);

                // Find corresponding start and length
                int start, length;
                paragraph.GetTextRangeFromNodes(lastLineCollection, out start, out length);

                // Select this in the text box
                selectedResultsTextBox.Text = paragraph.GetRecognizedString();
                selectedResultsTextBox.Select(start, length);

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

ParagraphNode 클래스

ParagraphNode 멤버

Microsoft.Ink 네임스페이스