Freigeben über


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 ContextNodeCollection FindInkLeafNodes ()
public function FindInkLeafNodes () : ContextNodeCollection
Not applicable.

Return Value

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.

Example

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 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
Microsoft.Ink Namespace
InkAnalyzer.FindLeafNodes
InkAnalyzer.FindNode
Microsoft.Ink.InkAnalyzer.FindNodes
Microsoft.Ink.InkAnalyzer.FindNodesOfType