ShapeGeometry.GetPath 方法
包括受保护的成员
包括继承的成员
在几何形状周围获取路径。 在应用 GetPath() 之前使用返回的路径于其他形状。 ,如果要保留路径,请使用 GetPathCopy() 。
重载此成员。有关此成员的完整信息(包括语法、用法和示例),请单击重载列表中的相应名称。
重载列表
名称 | 说明 | |
---|---|---|
![]() |
GetPath(IGeometryHost) | 在几何形状周围获取路径。在应用 GetPath() 之前使用返回的路径于其他形状。,如果要保留路径,请使用 GetPathCopy() 。 |
![]() |
GetPath(RectangleD) | 在几何形状周围获取路径。 |
页首
示例
此示例针对的是循环轧材。 通知使用 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;
}