共用方式為


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