InkAnalyzer.FindInkLeafNodes 方法

返回作为包含墨迹笔画的 ContextNode 对象的所有墨迹叶节点。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.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

返回值

类型:Microsoft.Ink.ContextNodeCollection
作为包含墨迹笔画的 ContextNode 对象的所有墨迹叶节点。

备注

墨迹叶节点示例包括 InkWordNodeInkDrawingNodeInkBulletNode

叶节点不包含子节点。

示例

下面的示例遍历 InkAnalyzer (theInkAnalyzer) 的所有墨迹叶节点。并将最低的叶节点设为红色。

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

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkAnalyzer 类

InkAnalyzer 成员

FindInkLeafNodes 重载

Microsoft.Ink 命名空间

InkAnalyzer.FindLeafNodes

InkAnalyzer.FindNode

InkAnalyzer.FindNodes

InkAnalyzer.FindNodesOfType