다음을 통해 공유


WritingRegionNode 클래스

업데이트: 2007년 11월

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

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink.Analysis(Microsoft.Ink.Analysis.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 개체에는 다음과 같은 형식의 자식 요소가 한 개 이상 포함될 수 있습니다.

  • ParagraphNode 개체의 수

  • Guid 값을 알 수 없는 노드(개수 제한 없음)

자세한 내용은 WritingRegion and AlignmentLevel에 대한 개념 항목을 참조하십시오.

예제

다음 예제에서는 해당 Text 속성이 WritingRegionNode, writingRegion에 대해 GetRecognizedString에서 반환한 값으로 설정된 TextBox인 selectedResultsTextBox를 사용합니다. 사용자는 TextBox의 텍스트를 선택합니다. 예제 코드에서는 이 선택 영역에 해당하는 Strokes를 표시합니다.

' 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.
' selectionLength must be > 0 or GetNodesFromTextRange(...) 
' will throw an ArgumentOutOfRangeException
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
Dim inkStroke As Stroke
For Each inkStroke In writingRegion.Strokes
    inkStroke.DrawingAttributes = New DrawingAttributes(Color.Black)
Next inkStroke
' Next, set all selected sub nodes to red
Dim node As ContextNode
For Each node In selectedRegionSubNodes
    For Each inkStroke In node.Strokes
        inkStroke.DrawingAttributes = New DrawingAttributes(Color.Red)
    Next inkStroke
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.
                    // selectionLength must be > 0 or GetNodesFromTextRange(...) 
                    // will throw an ArgumentOutOfRangeException
                    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 =
                                    new DrawingAttributes(Color.Black);
                    // Next, set all selected sub nodes to red
                    foreach (ContextNode node in selectedRegionSubNodes)
                    {
                        foreach (Stroke stroke in node.Strokes)
                        {
                            stroke.DrawingAttributes =
                                    new DrawingAttributes(Color.Red);
                        }
                    }

상속 계층 구조

System.Object
  Microsoft.Ink.ContextNode
    Microsoft.Ink.WritingRegionNode

스레드로부터의 안전성

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

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

WritingRegionNode 멤버

Microsoft.Ink 네임스페이스