ShapeGeometry.GetPath 方法 (RectangleD)
在几何形状周围获取路径。
命名空间: Microsoft.VisualStudio.Modeling.Diagrams
程序集: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0(在 Microsoft.VisualStudio.Modeling.Sdk.Diagrams.11.0.dll 中)
语法
声明
Protected Overridable Function GetPath ( _
boundingBox As RectangleD _
) As GraphicsPath
protected virtual GraphicsPath GetPath(
RectangleD boundingBox
)
参数
- boundingBox
类型:Microsoft.VisualStudio.Modeling.Diagrams.RectangleD
形状或链接的边界框,相对于形状的父级的左上角。
返回值
类型: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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。