Поделиться через


InkAnalyzer.FindInkLeafNodes - метод

Обновлен: Ноябрь 2007

Returns a ContextNodeCollection that contains all ink leaf nodes (ink leaf nodes are the ContextNode objects that contain ink strokes).

Пространство имен:  System.Windows.Ink
Сборка:  IAWinFX (в IAWinFX.dll)

Синтаксис

'Декларация
Public Function FindInkLeafNodes As ContextNodeCollection
'Применение
Dim instance As InkAnalyzer
Dim returnValue As ContextNodeCollection

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

Возвращаемое значение

Тип: System.Windows.Ink.ContextNodeCollection
All ink leaf nodes which include ContextNode objects that, in turn, contain ink strokes.

Заметки

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

Leaf nodes do not contain child nodes.

Примеры

The following example loops through all the ink leaf nodes of an InkAnalyzer, named theInkAnalyzer, to find the ContextNode with the lowest bottom bound. Once it finds the node with the lowest bound, it colors 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;
    }
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkAnalyzer Класс

InkAnalyzer - члены

FindInkLeafNodes - перегрузка

System.Windows.Ink - пространство имен

InkAnalyzer.FindLeafNodes

InkAnalyzer.FindNode

InkAnalyzer.FindNodes

InkAnalyzer.FindNodesOfType