업데이트: 2007년 11월
인식된 문자열의 지정된 텍스트 범위와 관련된 하위 ContextNode 개체의 컬렉션을 반환합니다.
네임스페이스: System.Windows.Ink
어셈블리: IAWinFX(IAWinFX.dll)
구문
‘선언
Public Function GetNodesFromTextRange ( _
ByRef start As Integer, _
ByRef length As Integer _
) As ContextNodeCollection
‘사용 방법
Dim instance As CustomRecognizerNode
Dim start As Integer
Dim length As Integer
Dim returnValue As ContextNodeCollection
returnValue = instance.GetNodesFromTextRange(start, _
length)
public ContextNodeCollection GetNodesFromTextRange(
ref int start,
ref int length
)
public:
ContextNodeCollection^ GetNodesFromTextRange(
int% start,
int% length
)
public ContextNodeCollection GetNodesFromTextRange(
/** @ref */int start,
/** @ref */int length
)
public function GetNodesFromTextRange(
start : int,
length : int
) : ContextNodeCollection
매개 변수
- start
형식: System.Int32%
인식된 문자열에서 텍스트 범위의 시작 위치입니다.
- length
형식: System.Int32%
인식된 문자열의 텍스트 범위 길이입니다.
반환 값
형식: System.Windows.Ink.ContextNodeCollection
인식된 문자열에서 지정된 텍스트 범위에 속하는 하위 ContextNode 개체의 컬렉션을 반환합니다.
설명
지정된 텍스트 범위의 기준은 전체 RootNode의 인식된 문자열이 아닌 이 CustomRecognizerNode의 인식된 문자열이어야 합니다.
예제
다음 예제에서는 이름이 selectedResultsTextBox인 TextBox를 사용합니다. 이전에 Text 속성은 이름이 customRecognizer인 CustomRecognizerNode 개체에 대해 GetRecognizedString에서 반환된 값으로 설정되어 있습니다. 사용자는 TextBox에서 일부 텍스트를 선택했습니다. InkRecognitionConfidence 수준이 Strong()이면 사용자의 선택 영역에 해당하는 Strokes가 빨간색으로 강조 표시됩니다.
' Find out what's been selected in the text box
Dim start As Integer = selectedResultsTextBox.SelectionStart
Dim length As Integer = selectedResultsTextBox.SelectionLength
' Return if no text is selected.
If length = 0 Then
Return
End If
' Only highlight if strong recognition
If customRecognizer.InkRecognitionConfidence = _
InkRecognitionConfidence.Strong Then
Dim selectedNodes As ContextNodeCollection = _
customRecognizer.GetNodesFromTextRange(start, length)
' Use the new start and length value to update the
' selection in the TextBox
selectedResultsTextBox.SelectionStart = start
selectedResultsTextBox.SelectionLength = length
' Color the strokes red if part of the selected words.
' Otherwise, color them black.
For Each Stroke As Stroke In customRecognizer.Strokes
Stroke.DrawingAttributes.Color = Colors.Black
Next Stroke
For Each selectedNode As ContextNode In selectedNodes
For Each Stroke As Stroke In selectedNode.Strokes
Stroke.DrawingAttributes.Color = Colors.Red
Next Stroke
Next selectedNode
End If
// Find out what's been selected in the text box
int start = selectedResultsTextBox.SelectionStart;
int length = selectedResultsTextBox.SelectionLength;
// Return if no text is selected.
if (length == 0)
return;
// Only highlight if strong recognition
if (customRecognizer.InkRecognitionConfidence == InkRecognitionConfidence.Strong)
{
ContextNodeCollection selectedNodes =
customRecognizer.GetNodesFromTextRange(ref start, ref length);
// Use the new start and length value to update the
// selection in the TextBox
selectedResultsTextBox.SelectionStart = start;
selectedResultsTextBox.SelectionLength = length;
// Color the strokes red if part of the selected words.
// Otherwise, color them black.
foreach (Stroke stroke in customRecognizer.Strokes)
{
stroke.DrawingAttributes.Color = Colors.Black;
}
foreach (ContextNode selectedNode in selectedNodes)
{
foreach (Stroke stroke in selectedNode.Strokes)
{
stroke.DrawingAttributes.Color = Colors.Red;
}
}
}
플랫폼
Windows Vista
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원