Condividi tramite


Metodo InkAnalyzer.FindInkLeafNodes

Aggiornamento: novembre 2007

Restituisce un oggetto ContextNodeCollection contenente tutti i nodi foglia dell'input penna. I nodi foglia dell'input penna sono gli oggetti ContextNode contenenti i tratti dell'input penna.

Spazio dei nomi:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.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: System.Windows.Ink.ContextNodeCollection
Tutti i nodi foglia dell'input penna che includono gli oggetti ContextNode che a loro volta contengono 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 seguente vengono riprodotti a ciclo continuo tutti i nodi foglia dell'input penna di un InkAnalyzer denominato theInkAnalyzer per trovare l'oggetto ContextNode con il limite inferiore più basso. Una volta trovato il nodo con il limite più basso, i tratti associati all'oggetto ContextNode più basso vengono colorati di rosso.

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

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 System.Windows.Ink

InkAnalyzer.FindLeafNodes

InkAnalyzer.FindNode

InkAnalyzer.FindNodes

InkAnalyzer.FindNodesOfType