Class GraphicsPath
内容
[
隐藏
]GraphicsPath class
代表一系列相连的直线和曲线。此类不能被继承。
public sealed class GraphicsPath : ObjectWithBounds
构造函数
| 姓名 | 描述 |
|---|---|
| GraphicsPath() | 初始化一个新的实例GraphicsPath类. |
| GraphicsPath(Figure[]) | 初始化一个新的实例GraphicsPath类. |
| GraphicsPath(FillMode) | 初始化一个新的实例GraphicsPath类. |
| GraphicsPath(Figure[], FillMode) | 初始化一个新的实例GraphicsPath类. |
特性
| 姓名 | 描述 |
|---|---|
| override Bounds { get; } | 获取或设置对象的边界。 |
| Figures { get; } | 获取路径数字。 |
| FillMode { get; set; } | 获取或设置一个FillMode确定形状内部如何在这个中的枚举GraphicsPath已满. |
方法
| 姓名 | 描述 |
|---|---|
| AddFigure(Figure) | 添加一个新图形。 |
| AddFigures(Figure[]) | 添加新图形。 |
| AddPath(GraphicsPath) | 追加指定的GraphicsPath到这条路. |
| AddPath(GraphicsPath, bool) | 追加指定的GraphicsPath到这条路. |
| DeepClone() | 执行此图形路径的深度克隆。 |
| Flatten() | 将此路径中的每条曲线转换为一系列连接的线段。 |
| Flatten(Matrix) | 应用指定的变换,然后在此转换每条曲线GraphicsPath成一系列连接的线段. |
| Flatten(Matrix, float) | 转换每条曲线GraphicsPath成一系列连接的线段. |
| override GetBounds(Matrix) | 获取对象的边界。 |
| override GetBounds(Matrix, Pen) | 获取对象的边界。 |
| IsOutlineVisible(Point, Pen) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen . |
| IsOutlineVisible(PointF, Pen) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen . |
| IsOutlineVisible(float, float, Pen) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen . |
| IsOutlineVisible(int, int, Pen) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen . |
| IsOutlineVisible(Point, Pen, Graphics) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen并使用指定的Graphics . |
| IsOutlineVisible(PointF, Pen, Graphics) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen并使用指定的Graphics . |
| IsOutlineVisible(float, float, Pen, Graphics) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen并使用指定的Graphics . |
| IsOutlineVisible(int, int, Pen, Graphics) | 表示指定点是否包含在这个轮廓之内(下)GraphicsPath当用指定的绘制Pen并使用指定的Graphics . |
| IsVisible(Point) | 表示指定点是否包含在此GraphicsPath . |
| IsVisible(PointF) | 表示指定点是否包含在此GraphicsPath . |
| IsVisible(float, float) | 表示指定点是否包含在此GraphicsPath . |
| IsVisible(int, int) | 表示指定点是否包含在此GraphicsPath . |
| IsVisible(Point, Graphics) | 表示指定点是否包含在此GraphicsPath . |
| IsVisible(PointF, Graphics) | 表示指定点是否包含在此GraphicsPath . |
| IsVisible(float, float, Graphics) | 表示指定点是否包含在此GraphicsPath在指定的可见剪辑区域Graphics . |
| IsVisible(int, int, Graphics) | 表示指定点是否包含在此GraphicsPath , 使用指定的Graphics . |
| RemoveFigure(Figure) | 删除图形。 |
| RemoveFigures(Figure[]) | 删除图形。 |
| Reset() | 清空图形路径并设置FillMode到Alternate . |
| Reverse() | 颠倒图形、形状和每个形状中的点的顺序GraphicsPath . |
| override Transform(Matrix) | 将指定的变换应用于形状。 |
| Warp(PointF[], RectangleF) | 将由矩形和平行四边形定义的扭曲变换应用于此GraphicsPath . |
| Warp(PointF[], RectangleF, Matrix) | 将由矩形和平行四边形定义的扭曲变换应用于此GraphicsPath . |
| Warp(PointF[], RectangleF, Matrix, WarpMode) | 将由矩形和平行四边形定义的扭曲变换应用于此GraphicsPath . |
| Warp(PointF[], RectangleF, Matrix, WarpMode, float) | 将由矩形和平行四边形定义的扭曲变换应用于此GraphicsPath . |
| Widen(Pen) | 向路径添加附加轮廓。 |
| Widen(Pen, Matrix) | 添加额外的大纲GraphicsPath . |
| Widen(Pen, Matrix, float) | 替换这个GraphicsPath当此路径由指定的笔绘制时,曲线包围填充的区域。 |
例子
此示例使用 GraphicsPath 和 Graphics 类在图像表面上创建和操作图形。示例创建一个新图像并在 GraphicsPath 类的帮助下绘制路径。最后调用 Graphics 类公开的 DrawPath 方法以在表面上呈现路径。最后将图像导出为 Tiff 文件格式。
[C#]
//创建图像实例
using (Aspose.PSD.Image image = new Aspose.PSD.FileFormats.Psd.PsdImage(500, 500))
{
//创建并初始化Graphics类的实例
Aspose.PSD.Graphics graphics = new Aspose.PSD.Graphics(image);
//清除图形表面
graphics.Clear(Color.Wheat);
//创建GraphicsPath类的一个实例
Aspose.PSD.GraphicsPath graphicspath = new Aspose.PSD.GraphicsPath();
//创建图类实例
Aspose.PSD.Figure figure = new Aspose.PSD.Figure();
//将Shapes添加到Figure对象
figure.AddShape(new Aspose.PSD.Shapes.RectangleShape(new RectangleF(10, 10, 300, 300)));
figure.AddShape(new Aspose.PSD.Shapes.EllipseShape(new RectangleF(50, 50, 300, 300)));
figure.AddShape(new Aspose.PSD.Shapes.PieShape(new Rectangle(new Point(250, 250), new Size(200, 200)), 0, 45));
//将Figure对象添加到GraphicsPath
graphicspath.AddFigure(figure);
//使用颜色为黑色的 Pen 对象绘制路径
graphics.DrawPath(new Pen(Aspose.PSD.Color.Black, 2), graphicspath);
//创建一个 TiffOptions 实例并设置它的各种属性
Aspose.PSD.ImageOptions.TiffOptions tiffOptions = new Aspose.PSD.ImageOptions.TiffOptions(Aspose.PSD.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
// 保存所有更改。
image.Save("C:\\temp\\output.tiff", tiffOptions);
}
也可以看看
- class ObjectWithBounds
- 命名空间 Aspose.PSD
- 部件 Aspose.PSD