Partager via


InkAnalyzer.FindInkLeafNodes Method ()

Returns a ContextNodeCollection that contains all of the ink leaf nodes, which are the ContextNode objects that contain ink strokes.

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.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 ContextNodeCollection FindInkLeafNodes ()
public function FindInkLeafNodes () : ContextNodeCollection
Not applicable.

Return Value

All ink leaf nodes which include ContextNode objects that contain ink strokes.

Remarks

Examples of ink leaf nodes are InkWordNode, InkDrawingNode, and InkBulletNode.

Leaf nodes do not contain child nodes.

Example

The following example loops through all the ink leaf nodes of an InkAnalyzer, theInkAnalyzer, to find the ContextNode with the lowest bottom bound. Once it finds the node with the lowest bound, it colors the strokes associated with the lowest ContextNode red.

Dim lowest As Double = Double.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 stroke As Stroke
    For Each stroke In  leafNode.Strokes
        stroke.DrawingAttributes.Color = Colors.Black
    Next stroke
Next leafNode
' Set lowest stroke to red
If Not (lowestNode Is Nothing) Then
    Dim stroke As Stroke
    For Each stroke In  lowestNode.Strokes
        stroke.DrawingAttributes.Color = Colors.Red
    Next stroke
End If
double lowest = double.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.Color = Colors.Black;
    }
}
// Set lowest stroke to red
if (lowestNode != null)
{
    foreach (Stroke stroke in lowestNode.Strokes)
    {
        stroke.DrawingAttributes.Color = Colors.Red;
    }
}

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzer Class
InkAnalyzer Members
System.Windows.Ink Namespace
InkAnalyzer.FindLeafNodes
InkAnalyzer.FindNode
System.Windows.Ink.InkAnalyzer.FindNodes
System.Windows.Ink.InkAnalyzer.FindNodesOfType