ShapeGeometry.GetPath Method (RectangleD)
Gets the path around the shape geometry.
Namespace: Microsoft.VisualStudio.Modeling.Diagrams
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll)
Syntax
'Declaration
Protected Overridable Function GetPath ( _
boundingBox As RectangleD _
) As GraphicsPath
protected virtual GraphicsPath GetPath(
RectangleD boundingBox
)
protected:
virtual GraphicsPath^ GetPath(
RectangleD boundingBox
)
abstract GetPath :
boundingBox:RectangleD -> GraphicsPath
override GetPath :
boundingBox:RectangleD -> GraphicsPath
protected function GetPath(
boundingBox : RectangleD
) : GraphicsPath
Parameters
boundingBox
Type: Microsoft.VisualStudio.Modeling.Diagrams.RectangleDThe bounding box for the shape or link, relative to the top-left corner of the shape’s parent.
Return Value
Type: GraphicsPath
The path around the shape geometry.
Remarks
This property returns a reference to the path used by this geometry. Do not dispose it. Use the path before using GetPath() again. If you require a copy, use GetPathCopy.
Examples
This example is for a circular shape. Notice that UninitializedPath is used and reset.
/// <summary>
/// Gets the GraphicsPath of the geometry.
/// Returns a reference to the path - do not dispose it.
/// </summary>
/// <param name="boundingBox">The bounding box of the shape.</param>
/// <returns>The GraphicsPath of the geometry.</returns>
protected override GraphicsPath GetPath(RectangleD boundingBox)
{
GraphicsPath path = UninitializedPath;
path.Reset();
path.AddEllipse((float)boundingBox.X, (float)boundingBox.Y, (float)boundingBox.Width, (float)boundingBox.Height);
return path;
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.