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;
}