다음을 통해 공유


InkWordNode 클래스

업데이트: 2007년 11월

인식 가능한 단어를 형성하는 논리적 그룹화를 구성하는 스트로크 컬렉션에 대한 ContextNode를 나타냅니다.

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

구문

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

설명

InkWordNode 개체에는 자식이 포함될 수 없습니다.

예제

다음 예제에서는 InkAnalyzer인 theInkAnalyzer에서 모든 InkWordNode 개체를 반복하면서 회전된 경계 사각형, 어센더, 디센더, 중간선 및 기준선을 보여 주는 선을 그립니다. 선은 Panel인 theNotesPanel에 그려집니다.

    Dim panelGraphics As Graphics = theNotesPanel.CreateGraphics()
    Dim theRenderer As Renderer = theInkCollector.Renderer

    ' Loop through all of the ink words
    Dim inkWords As ContextNodeCollection = _
        theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord)
    Dim inkWord As InkWordNode
    For Each inkWord In inkWords
        ' Show rotated bounding box in blue
        ' Convert corners to pixel coordinates
        Dim corners As Point() = inkWord.GetRotatedBoundingBox()
        theRenderer.InkSpaceToPixel(panelGraphics, corners)
        ' Draw the rectangle
        panelGraphics.DrawPolygon(New Pen(Color.Blue), corners)

        ' Show the ascender line in green
        Dim ascenderPoints As Point() = inkWord.GetAscender()
        ' Convert to pixel coordinates
        theRenderer.InkSpaceToPixel(panelGraphics, ascenderPoints)
        panelGraphics.DrawLines(New Pen(Color.Green), ascenderPoints)

        ' Show the baseline in purple
        Dim basePoints As Point() = inkWord.GetBaseline()
        ' Convert to pixel coordinates
        theRenderer.InkSpaceToPixel(panelGraphics, basePoints)
        panelGraphics.DrawLines(New Pen(Color.Purple), basePoints)

        ' Show the descender line in yellow
        Dim descenderPoints As Point() = inkWord.GetDescender()
        ' Convert to pixel coordinates
        theRenderer.InkSpaceToPixel(panelGraphics, descenderPoints)
        panelGraphics.DrawLines(New Pen(Color.Yellow), descenderPoints)

        ' Show the mid line in brown
        Dim midlinePoints As Point() = inkWord.GetMidline()
        ' Convert to pixel coordinates
        theRenderer.InkSpaceToPixel(panelGraphics, midlinePoints)
        panelGraphics.DrawLines(New Pen(Color.Brown), midlinePoints)
    Next inkWord

    panelGraphics.Dispose()

End Sub 'inkWordMenuItem_Click
            Graphics panelGraphics = theNotesPanel.CreateGraphics();
            Renderer theRenderer = theInkCollector.Renderer;

            // Loop through all of the ink words
            ContextNodeCollection inkWords =
                theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkWord);
            foreach (InkWordNode inkWord in inkWords)
            {
                // Show rotated bounding box in blue
                // Convert corners to pixel coordinates
                Point[] corners = inkWord.GetRotatedBoundingBox();
                theRenderer.InkSpaceToPixel(panelGraphics, ref corners);
                // Draw the rectangle
                panelGraphics.DrawPolygon(new Pen(Color.Blue), corners);

                // Show the ascender line in green
                Point[] ascenderPoints = inkWord.GetAscender();
                // Convert to pixel coordinates
                theRenderer.InkSpaceToPixel(panelGraphics, ref ascenderPoints);
                panelGraphics.DrawLines(new Pen(Color.Green), ascenderPoints);

                // Show the baseline in purple
                Point[] basePoints = inkWord.GetBaseline();
                // Convert to pixel coordinates
                theRenderer.InkSpaceToPixel(panelGraphics, ref basePoints);
                panelGraphics.DrawLines(new Pen(Color.Purple), basePoints);

                // Show the descender line in yellow
                Point[] descenderPoints = inkWord.GetDescender();
                // Convert to pixel coordinates
                theRenderer.InkSpaceToPixel(panelGraphics, ref descenderPoints);
                panelGraphics.DrawLines(new Pen(Color.Yellow), descenderPoints);

                // Show the mid line in brown
                Point[] midlinePoints = inkWord.GetMidline();
                // Convert to pixel coordinates
                theRenderer.InkSpaceToPixel(panelGraphics, ref midlinePoints);
                panelGraphics.DrawLines(new Pen(Color.Brown), midlinePoints);
            }

            panelGraphics.Dispose();

상속 계층 구조

System.Object
  Microsoft.Ink.ContextNode
    Microsoft.Ink.InkWordNode

스레드로부터의 안전성

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

플랫폼

Windows Vista

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

InkWordNode 멤버

Microsoft.Ink 네임스페이스