共用方式為


ShapeGeometry.GetPath Method (RectangleD)

Gets the path around the shape geometry.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)

Syntax

'宣告
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

Return Value

Type: System.Drawing.Drawing2D.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

See Also

Reference

ShapeGeometry Class

GetPath Overload

Microsoft.VisualStudio.Modeling.Diagrams Namespace