SetGeometryPath
IGeometryShape.SetGeometryPath метод
Обновляет геометрию формы из объекта IGeometryPath. Координаты должны относиться к верхнему левому углу формы. Изменяет тип формы (ShapeType) на Custom.
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