Sdílet prostřednictvím


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 ();
}
public function get Location () : AnalysisRegionBase

Property Value

Type: System.Windows.Ink.AnalysisCore.AnalysisRegionBase
The position and size of the ContextNodeBase object.

Remarks

The location for a container node is determined by determining the union of all the leaf's locations. The location for an ink leaf node is determined by examining the union of all stroke locations. The location for a non-ink leaf node is determined by the original user settings on those nodes.

Examples

This example draws a blue box around a ContextNodeBase named currentNode, whose strokes were drawn on a Panel named 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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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