com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Interface IGeometryShape

    • Method Detail

      • getGeometryPaths

        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();
         }
          
        Returns:
        Array of IGeometryPath
      • setGeometryPath

        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();
         }
          
        Parameters:
        geometryPath - Geometry path
        Throws:
        com.aspose.ms.System.ArgumentException - No path found
        com.aspose.ms.System.ArgumentException - Empty path found
      • setGeometryPaths

        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();
         }
          
        Parameters:
        geometryPaths - Array geometry paths
        Throws:
        com.aspose.ms.System.ArgumentException - No path found
        com.aspose.ms.System.ArgumentException - Empty path
      • getShapeType

        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.

      • setShapeType

        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.

      • createShapeElements

        IShapeElement[] createShapeElements()

        Creates and returns array of shape's elements.

        Returns:
        Array of IShapeElement