com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class GeometryShape

    • Method Detail

      • getGeometryPaths

        public final IGeometryPath[] getGeometryPaths()

        Returns the copy of path of the geometry shape. Coordinates are relative to the left top corner of the shape.


         Presentation pres = new Presentation();
         try {
             GeometryShape shape = (GeometryShape) pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 200, 100);
             IGeometryPath geometryPath = shape.getGeometryPaths()[0];
             geometryPath.lineTo(100, 50, 1);
             geometryPath.lineTo(100, 50, 4);
             shape.setGeometryPath(geometryPath);
             pres.save("output.pptx", SaveFormat.Pptx);
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Specified by:
        getGeometryPaths in interface IGeometryShape
        Returns:
        Array of IGeometryPath
      • setGeometryPath

        public final void setGeometryPath(IGeometryPath geometryPath)

        Updates shape geometry from IGeometryPath object. Coordinates must be relative to the left top corner of the shape. Changes the type of the shape (ShapeType(getShapeType()/setShapeType(int))) to ShapeType.Custom.


         Presentation pres = new Presentation();
         try {
             GeometryShape shape = (GeometryShape) pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 200, 100);
             GeometryPath geometryPath0 = new GeometryPath();
             geometryPath0.moveTo(0, 0);
             geometryPath0.lineTo(shape.getWidth(), 0);
             geometryPath0.lineTo(shape.getWidth(), shape.getHeight()/3);
             geometryPath0.lineTo(0, shape.getHeight() / 3);
             geometryPath0.closeFigure();
             GeometryPath geometryPath1 = new GeometryPath();
             geometryPath1.moveTo(0, shape.getHeight()/3 * 2);
             geometryPath1.lineTo(shape.getWidth(), shape.getHeight() / 3 * 2);
             geometryPath1.lineTo(shape.getWidth(), shape.getHeight());
             geometryPath1.lineTo(0, shape.getHeight());
             geometryPath1.closeFigure();
             shape.setGeometryPaths(new GeometryPath[] { geometryPath0, geometryPath1});
             pres.save("output.pptx", SaveFormat.Pptx);
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Specified by:
        setGeometryPath in interface IGeometryShape
        Parameters:
        geometryPath - Geometry path
        Throws:
        com.aspose.ms.System.ArgumentException - No path found
        com.aspose.ms.System.ArgumentException - Empty path found
      • setGeometryPaths

        public final void setGeometryPaths(IGeometryPath[] geometryPaths)

        Updates shape geometry from array of IGeometryPath. Coordinates must be relative to the left top corner of the shape. Changes the type of the shape (ShapeType(getShapeType()/setShapeType(int))) to ShapeType.Custom.


         Presentation pres = new Presentation();
         try {
             GeometryShape shape = (GeometryShape)pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 200, 100);
             IGeometryPath geometryPath = shape.getGeometryPaths()[0];
             geometryPath.lineTo(100, 50, 1);
             geometryPath.lineTo(100, 50, 4);
             shape.setGeometryPath(geometryPath);
             pres.save("output.pptx", SaveFormat.Pptx);
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Specified by:
        setGeometryPaths in interface IGeometryShape
        Parameters:
        geometryPaths - Array geometry paths
        Throws:
        com.aspose.ms.System.ArgumentException - No path found
        com.aspose.ms.System.ArgumentException - Empty path
      • getShapeType

        public int getShapeType()

        Returns or sets the geometry preset type. Note: on value changing all adjustment values will reset to their default values. Read/write ShapeType.

        Specified by:
        getShapeType in interface IGeometryShape
      • setShapeType

        public void setShapeType(int value)

        Returns or sets the geometry preset type. Note: on value changing all adjustment values will reset to their default values. Read/write ShapeType.

        Specified by:
        setShapeType in interface IGeometryShape