InkAnalyzer.FindInkLeafNodes Method
Returns all of the ink leaf nodes, which are the ContextNode objects that contain ink strokes.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)
Syntax
'Declaration
Public Function FindInkLeafNodes As ContextNodeCollection
'Usage
Dim instance As InkAnalyzer
Dim returnValue As ContextNodeCollection
returnValue = instance.FindInkLeafNodes()
public ContextNodeCollection FindInkLeafNodes()
public:
ContextNodeCollection^ FindInkLeafNodes()
public function FindInkLeafNodes() : ContextNodeCollection
Return Value
Type: Microsoft.Ink.ContextNodeCollection
All of the ink leaf nodes, which are the ContextNode objects that contain ink strokes.
Remarks
Examples of ink leaf nodes are InkWordNode, InkDrawingNode, and InkBulletNode.
Leaf nodes do not contain child nodes.
Examples
The following example loops through all the ink leaf nodes of an InkAnalyzer, theInkAnalyzer. It colors the lowest one red.
Dim lowest As Integer = Integer.MinValue
Dim lowestNode As ContextNode = Nothing
Dim leafNode As ContextNode
For Each leafNode In theInkAnalyzer.FindInkLeafNodes()
' Find lowest node
If leafNode.Location.GetBounds().Bottom > lowest Then
lowestNode = leafNode
lowest = leafNode.Location.GetBounds().Bottom
End If
' Set each stroke to black
Dim inkStroke As Stroke
For Each inkStroke In leafNode.Strokes
inkStroke.DrawingAttributes = New DrawingAttributes(Color.Black)
Next inkStroke
Next leafNode
' Set lowest stroke to red
If Not (lowestNode Is Nothing) Then
Dim inkStroke As Stroke
For Each inkStroke In lowestNode.Strokes
inkStroke.DrawingAttributes = New DrawingAttributes(Color.Red)
Next inkStroke
End If
int lowest = int.MinValue;
ContextNode lowestNode = null;
foreach (ContextNode leafNode in theInkAnalyzer.FindInkLeafNodes())
{
// Find lowest node
if (leafNode.Location.GetBounds().Bottom > lowest)
{
lowestNode = leafNode;
lowest = leafNode.Location.GetBounds().Bottom;
}
// Set each stroke to black
foreach (Stroke stroke in leafNode.Strokes)
{
stroke.DrawingAttributes = new DrawingAttributes(Color.Black);
}
}
// Set lowest stroke to red
if (lowestNode != null)
{
foreach (Stroke stroke in lowestNode.Strokes)
{
stroke.DrawingAttributes = new DrawingAttributes(Color.Red);
}
}
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