Freigeben über


ContextNodeBase.Location Property

Gets the position and size of the ContextNodeBase object.

Namespace: System.Windows.Ink.AnalysisCore
Assembly: IACore (in iacore.dll)

Syntax

'Declaration
Public ReadOnly Property Location As AnalysisRegionBase
'Usage
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
Not applicable.

Property Value

The position and size of the ContextNodeBase object.

Remarks

The location for a container node is determined by unioning all the leaf's locations. The location for an ink leaf nodes is determined by unioning the strokes locations. The location for a non-ink leaf node is determined by whatever the user originally set on those nodes.

Example

This example draws a blue box around a ContextNodeBase, currentNode, whose strokes were drawn on a 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();

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

ContextNodeBase Class
ContextNodeBase Members
System.Windows.Ink.AnalysisCore Namespace
ContextNodeBase.Location
System.Windows.Ink.AnalysisCore.AnalysisRegionBase