LineNode Class
Represents a ContextNode for a line of words.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)
Syntax
'Declaration
Public NotInheritable Class LineNode _
Inherits ContextNode
'Usage
Dim instance As LineNode
public sealed class LineNode : ContextNode
public ref class LineNode sealed : public ContextNode
public final class LineNode extends ContextNode
Remarks
A LineNode object can contain the following types of children:
Any number of InkWordNode objects.
Any number of TextWordNode objects.
Ihe InkAnalysis API allows you to create a LineNode that contains ink words and text words. However, the parser will ignore these mixed nodes and will treat them like foreign nodes. This will have impact the parsing accuracy of detecting ink annotations when the end user writes on or around this mixed node.
Examples
The following example loops through all LineNode objects from an InkAnalyzer, theInkAnalyzer, and then draws lines that show the rotated bounding rectangle, the ascender, the descender, the midline, and the baseline. The lines are drawn on a Panel, theNotesPanel, that has an InkCollector, theInkCollector.
Dim panelGraphics As Graphics = theNotesPanel.CreateGraphics()
Dim theRenderer As Renderer = theInkCollector.Renderer
' Loop through all of the lines
Dim lines As ContextNodeCollection = _
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.Line)
For Each line As LineNode In lines
' Show rotated bounding box in blue
' Convert corners to pixel coordinates
Dim corners As Point() = line.GetRotatedBoundingBox()
theRenderer.InkSpaceToPixel(panelGraphics, corners)
' Draw the rectangle
panelGraphics.DrawPolygon(New Pen(Color.Blue), corners)
Next line
panelGraphics.Dispose()
Graphics panelGraphics = theNotesPanel.CreateGraphics();
Renderer theRenderer = theInkCollector.Renderer;
// Loop through all of the lines
ContextNodeCollection lines =
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.Line);
foreach (LineNode line in lines)
{
// Show rotated bounding box in blue
// Convert corners to pixel coordinates
Point[] corners = line.GetRotatedBoundingBox();
theRenderer.InkSpaceToPixel(panelGraphics, ref corners);
// Draw the rectangle
panelGraphics.DrawPolygon(new Pen(Color.Blue), corners);
}
panelGraphics.Dispose();
Inheritance Hierarchy
System.Object
Microsoft.Ink.ContextNode
Microsoft.Ink.LineNode
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0