共用方式為


ContextNodeBase.Location 屬性

取得 ContextNodeBase 物件的位置和大小。

命名空間:  System.Windows.Ink.AnalysisCore
組件:  IACore (在 IACore.dll 中)

語法

'宣告
Public ReadOnly Property Location As AnalysisRegionBase
'用途
Dim instance As ContextNodeBase
Dim value As AnalysisRegionBase

value = instance.Location
public AnalysisRegionBase Location { get; }
public:
property AnalysisRegionBase^ Location {
    AnalysisRegionBase^ get ();
}
/** @property */
public AnalysisRegionBase get_Location()
public function get Location () : AnalysisRegionBase

屬性值

型別:System.Windows.Ink.AnalysisCore.AnalysisRegionBase
ContextNodeBase 物件的位置和大小。

備註

容器 (Container) 節點的位置是透過判斷所有分葉位置的等位來判斷的。筆墨分葉節點的位置是透過檢查所有筆劃位置的等位來判斷的。非筆墨分葉節點的位置則是由這些節點上的原始使用者設定決定。

範例

這個範例會在 ContextNodeBase (名為 currentNode) 周圍繪製藍色的方塊,而其筆劃繪製於 Panel (名為 theNotePanel) 上。

' Convert bounds to pixels
Dim panelGraphics As Graphics = Me.theNotesPanel.CreateGraphics()
Dim nodeBounds() As Integer = currentNode.Location.GetBounds()
Dim upperLeft As New Point(nodeBounds(0), nodeBounds(1))
Dim lowerRight As New Point(nodeBounds(2), nodeBounds(3))
Me.theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, upperLeft)
Me.theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, lowerRight)

' Draw rectangle
panelGraphics.DrawRectangle(New Pen(Color.Blue), upperLeft.X, upperLeft.Y, lowerRight.X - upperLeft.X, lowerRight.Y - upperLeft.Y)
panelGraphics.Dispose()
// Convert bounds to pixels
Graphics panelGraphics = this.theNotesPanel.CreateGraphics();
int[] nodeBounds = currentNode.Location.GetBounds();
Point upperLeft = new Point(nodeBounds[0], nodeBounds[1]);
Point lowerRight = new Point(nodeBounds[2], nodeBounds[3]);
this.theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, ref upperLeft);
this.theInkCollector.Renderer.InkSpaceToPixel(panelGraphics, ref lowerRight);

// Draw rectangle
panelGraphics.DrawRectangle(new Pen(Color.Blue),
    upperLeft.X, upperLeft.Y, lowerRight.X - upperLeft.X,
    lowerRight.Y - upperLeft.Y);
panelGraphics.Dispose();

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

ContextNodeBase 類別

ContextNodeBase 成員

System.Windows.Ink.AnalysisCore 命名空間

ContextNodeBase.Location

System.Windows.Ink.AnalysisCore.AnalysisRegionBase