SetGeometryPaths

GeometryShape.SetGeometryPaths 方法

IGeometryPath数组更新形状几何图形。坐标必须相对于形状的左上角。将形状的类型(ShapeType)更改为自定义。

public void SetGeometryPaths(IGeometryPath[] geometryPaths)
参数类型描述
geometryPathsIGeometryPath[]几何路径数组

异常

异常条件
ArgumentException未找到路径
ArgumentException路径为空

示例

示例:

[C#]
using (Presentation pres = new Presentation())
{
    GeometryShape shape = pres.Slides[0].Shapes.AddAutoShape(ShapeType.Rectangle, 100, 100, 200, 100) as GeometryShape;

    GeometryPath geometryPath = shape.GetGeometryPaths()[0];

    geometryPath.LineTo(100, 50, 1);
    geometryPath.LineTo(100, 50, 4);

    shape.SetGeometryPath(geometryPath);

    pres.Save("output.pptx", SaveFormat.Pptx);
}

另请参阅