SetGeometryPath
IGeometryShape.SetGeometryPath 方法
从 IGeometryPath 对象更新形状几何形状。坐标必须相对于形状的左上角。将形状的类型(ShapeType)更改为自定义。
public void SetGeometryPath(IGeometryPath geometryPath)
| 参数 | 类型 | 描述 | 
|---|---|---|
| geometryPath | IGeometryPath | 几何路径 | 
异常
| 异常 | 条件 | 
|---|---|
| ArgumentException | 找不到路径 | 
| ArgumentException | 找到空路径 | 
示例
示例:
[C#]
using (Presentation pres = new Presentation())
{
    GeometryShape shape = pres.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 100, 100, 200, 100) as GeometryShape;
    GeometryPath geometryPath0 = new GeometryPath();
    geometryPath0.MoveTo(0, 0);
    geometryPath0.LineTo(shape.Width, 0);
    geometryPath0.LineTo(shape.Width, shape.Height/3);
    geometryPath0.LineTo(0, shape.Height / 3);
    geometryPath0.CloseFigure();
    GeometryPath geometryPath1 = new GeometryPath();
    geometryPath1.MoveTo(0, shape.Height/3 * 2);
    geometryPath1.LineTo(shape.Width, shape.Height / 3 * 2);
    geometryPath1.LineTo(shape.Width, shape.Height);
    geometryPath1.LineTo(0, shape.Height);
    geometryPath1.CloseFigure();
    shape.SetGeometryPaths(new GeometryPath[] { geometryPath0, geometryPath1});
    pres.Save("output.pptx", SaveFormat.Pptx);
}
另见
- 接口 IGeometryPath
- 接口 IGeometryShape
- 命名空间 Aspose.Slides
- 程序集 Aspose.Slides