다음을 통해 공유


WritingRegionNode 클래스

업데이트: 2007년 11월

방향이 유사한 단락 그룹을 나타냅니다.

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

구문

‘선언
Public NotInheritable Class WritingRegionNode _
    Inherits ContextNode
‘사용 방법
Dim instance As WritingRegionNode
public sealed class WritingRegionNode : ContextNode
public ref class WritingRegionNode sealed : public ContextNode
public final class WritingRegionNode extends ContextNode
public final class WritingRegionNode extends ContextNode

설명

쓰기 영역에는 읽기 순서(예: 위에서 아래로)가 하나만 있습니다.

같은 문서의 같은 페이지에 방향이 서로 다른 여러 쓰기 영역이 있을 수 있습니다. 예를 들어 사용자가 계속 가로 방향으로 필기하다가 모퉁이에서 몇 단어를 대각선으로 쓰면 대각선 단어의 방향이 다른 것으로 인식됩니다. 이러한 대각선 텍스트에 대해서는 새로운 WritingRegion이 만들어집니다.

WritingRegionNode 개체에는 다음과 같은 형식의 자식 요소가 여러 개 포함될 수 있습니다.

예제

다음 예제에서는 WritingRegionNode 메서드를 사용하여 선택된 텍스트에 해당하는 스트로크를 표시합니다. 예제 코드에서는 이름이 theResultsTextBox인 TextBoxText 속성이 GetRecognizedString 메서드에서 반환된 값으로 설정된다고 가정합니다. 또한 예제에서는 사용자가 theResultsTextBox에서 텍스트를 선택했으며 이름이 theInkAnalyzer인 InkAnalyzer가 있다고 가정합니다.

' Find out what's been selected in the text box
Dim selectionStart As Integer = selectedResultsTextBox.SelectionStart
Dim selectionLength As Integer = selectedResultsTextBox.SelectionLength

' Return if no text is selected.
If selectionLength = 0 Then
    Return
End If 
' Get the nodes that correspond to that range
Dim selectedRegionSubNodes As ContextNodeCollection = writingRegion.GetNodesFromTextRange(selectionStart, selectionLength)


' Use the new start and length value to update the
' selection in the TextBox
selectedResultsTextBox.SelectionStart = selectionStart
selectedResultsTextBox.SelectionLength = selectionLength

' First, set all strokes to black
For Each stroke As Stroke In writingRegion.Strokes
    stroke.DrawingAttributes.Color = Colors.Black
Next stroke

' Next, set all selected sub nodes to red
For Each node As ContextNode In selectedRegionSubNodes
    For Each stroke As Stroke In node.Strokes
        stroke.DrawingAttributes.Color = Colors.Red
    Next stroke
Next node
// Find out what's been selected in the text box
int selectionStart = selectedResultsTextBox.SelectionStart;
int selectionLength = selectedResultsTextBox.SelectionLength;

// Return if no text is selected.
if (selectionLength == 0)
    return;

// Get the nodes that correspond to that range
ContextNodeCollection selectedRegionSubNodes =
        writingRegion.GetNodesFromTextRange(ref selectionStart, ref selectionLength);


// Use the new start and length value to update the
// selection in the TextBox
selectedResultsTextBox.SelectionStart = selectionStart;
selectedResultsTextBox.SelectionLength = selectionLength;

// First, set all strokes to black
foreach (Stroke stroke in writingRegion.Strokes)
    stroke.DrawingAttributes.Color = Colors.Black;
// Next, set all selected sub nodes to red
foreach (ContextNode node in selectedRegionSubNodes)
{
    foreach (Stroke stroke in node.Strokes)
    {
        stroke.DrawingAttributes.Color = Colors.Red;
    }
}

상속 계층 구조

System.Object
  System.Windows.Ink.ContextNode
    System.Windows.Ink.WritingRegionNode

스레드로부터의 안전성

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

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

WritingRegionNode 멤버

System.Windows.Ink 네임스페이스