傳回包含所有筆墨分葉節點的 ContextNodeCollection (筆墨分葉節點就是包含筆墨筆劃的 ContextNode 物件)。
命名空間: 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
所有筆墨分葉節點,這些節點包括內含筆墨筆劃的 ContextNode 物件。
備註
筆墨分葉節點的範例包括 InkWordNode、InkDrawingNode 及 InkBulletNode。
分葉節點不包含子節點。
範例
下列範例會對 InkAnalyzer (名為 theInkAnalyzer) 的所有筆墨分葉節點執行迴圈,以尋找具有最低下限的 ContextNode。一旦找到具有最低下限的節點,則會將與最低 ContextNode 相關聯的筆劃設定為紅色。
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