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 对象的位置和大小。

备注

容器节点的位置是通过确定所有叶的位置的并集来确定的。墨迹叶节点的位置是通过检查所有笔画位置的并集来确定的。非墨迹叶节点的位置是通过这些节点上的原始用户设置来确定的。

示例

此示例在名为 currentNode 的 ContextNodeBase 周围绘制一个蓝色的框,该节点的笔画已在名为 theNotePanel 的 Panel 上绘制。

' 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