ShapeGeometry.GetPath 方法 (RectangleD)

获取形状几何图形周围的路径。

命名空间:  Microsoft.VisualStudio.Modeling.Diagrams
程序集:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0(在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll 中)

语法

声明
Protected Overridable Function GetPath ( _
    boundingBox As RectangleD _
) As GraphicsPath
protected virtual GraphicsPath GetPath(
    RectangleD boundingBox
)

参数

返回值

类型:System.Drawing.Drawing2D.GraphicsPath
形状几何图形周围的路径。

备注

此属性返回到此使用几何路径的引用。 不要将其配置为。 在再次使用 GetPath() 之前使用路径。 如果您需要一个副本,请使用 GetPathCopy

示例

此示例针对的是循环轧材。 通知使用 UninitializedPath 并重置。

/// <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 安全性

请参阅

参考

ShapeGeometry 类

GetPath 重载

Microsoft.VisualStudio.Modeling.Diagrams 命名空间