Condividi tramite


Metodo InkAnalyzer.FindInkLeafNodes

Aggiornamento: novembre 2007

Restituisce tutti i nodi foglia dell'input penna che sono gli oggetti ContextNode contenenti i tratti dell'input penna.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Sintassi

'Dichiarazione
Public Function FindInkLeafNodes As ContextNodeCollection
'Utilizzo
Dim instance As InkAnalyzer
Dim returnValue As ContextNodeCollection

returnValue = instance.FindInkLeafNodes()
public ContextNodeCollection FindInkLeafNodes()
public:
ContextNodeCollection^ FindInkLeafNodes()
public ContextNodeCollection FindInkLeafNodes()
public function FindInkLeafNodes() : ContextNodeCollection

Valore restituito

Tipo: Microsoft.Ink.ContextNodeCollection
Tutti i nodi foglia dell'input penna che sono gli oggetti ContextNode contenenti i tratti dell'input penna.

Note

Esempi di nodi foglia sono InkWordNode, InkDrawingNode e InkBulletNode.

I nodi foglia non contengono nodi figlio.

Esempi

Nell'esempio riportato di seguito vengono riprodotti a ciclo continuo tutti i nodi foglia dell'input penna di un oggetto InkAnalyzer, theInkAnalyzer. Quello più in basso viene colorato di rosso.

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);
                }
            }

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

InkAnalyzer Classe

Membri InkAnalyzer

Overload FindInkLeafNodes

Spazio dei nomi Microsoft.Ink

InkAnalyzer.FindLeafNodes

InkAnalyzer.FindNode

InkAnalyzer.FindNodes

InkAnalyzer.FindNodesOfType