Поделиться через


ContextNode.Location - свойство

Обновлен: Ноябрь 2007

Gets the position and size of the ContextNode object.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.dll)

Синтаксис

'Декларация
Public ReadOnly Property Location As AnalysisRegion
'Применение
Dim instance As ContextNode
Dim value As AnalysisRegion

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

Значение свойства

Тип: Microsoft.Ink.AnalysisRegion
The position and size of the ContextNode object.

Заметки

The location for a given ContextNode is determined by the union of the location of all strokes. If the ContextNode is a leaf node, strokes associated with that node are used. If the ContextNode is not a leaf node, all descendant leaf ContextNode objects are used to determine the location of the ContextNode.

If the ContextNode is not an ink leaf node or does not have any descendant ink leaf nodes, the node is considered to be a non-ink node or an ancestor of one or more non-ink nodes. The location of this type of node is determined by the location value of the non-ink leaf nodes.

Примеры

This example draws a blue box around a ContextNode, cNode, whose strokes have been drawn on a Panel, theNotePanel.

' Convert bounds to pixels
Dim panelGraphics As Graphics = Me.theNotesPanel.CreateGraphics()
Dim nodeBounds As Rectangle = currentNode.Location.GetBounds()
Dim upperLeft As Point = nodeBounds.Location
Dim lowerRight As New Point(nodeBounds.Right, nodeBounds.Bottom)
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();
                Rectangle nodeBounds = currentNode.Location.GetBounds();
                Point upperLeft = nodeBounds.Location;
                Point lowerRight = new Point(nodeBounds.Right, nodeBounds.Bottom);
                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

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

ContextNode Класс

ContextNode - члены

Microsoft.Ink - пространство имен

Microsoft.Ink.AnalysisRegion