[]
        
(Showing Draft Content)

ICrop

Interface ICrop


public interface ICrop
Represents the cropping settings for an image.

An ICrop object defines the source image size, the image offsets, and the shape bounds used to display only part of the image. You can obtain this interface from IPictureFormat.getCrop().


 worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
 IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
 ICrop crop = picture.getPictureFormat().getCrop();
 crop.setPictureWidth(160);
 crop.setPictureHeight(100);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the height of the image that is to be cropped.
    double
    Gets the x-axis offset of the image that is to be cropped.
    double
    Gets the y-axis offset of the image that is to be cropped.
    double
    Gets the width of the image that is to be cropped.
    double
    Gets the height of a shape that is used to crop an image.
    double
    Gets the location of the left-side of a shape that is used to crop an image.
    double
    Gets the location of the top of a shape that is used to crop an image.
    double
    Gets the width of a shape that is used to crop an image.
    void
    setPictureHeight(double value)
    Sets the height of the image that is to be cropped.
    void
    setPictureOffsetX(double value)
    Sets the x-axis offset of the image that is to be cropped.
    void
    setPictureOffsetY(double value)
    Sets the y-axis offset of the image that is to be cropped.
    void
    setPictureWidth(double value)
    Sets the width of the image that is to be cropped.
    void
    setShapeHeight(double value)
    Sets the height of a shape that is used to crop an image.
    void
    setShapeLeft(double value)
    Sets the location of the left-side of a shape that is used to crop an image.
    void
    setShapeTop(double value)
    Sets the location of the top of a shape that is used to crop an image.
    void
    setShapeWidth(double value)
    Sets the width of a shape that is used to crop an image.
  • Method Details

    • getPictureHeight

      double getPictureHeight()
      Gets the height of the image that is to be cropped.

      This value represents the source image height currently used by the cropping settings.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureHeight(100);
       double pictureHeight = crop.getPictureHeight();
       
      Returns:
      The height of the image that is to be cropped.
    • setPictureHeight

      void setPictureHeight(double value)
      Sets the height of the image that is to be cropped.

      This value represents the source image height currently used by the cropping settings.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureHeight(100.0);
       
      Parameters:
      value - The height of the image that is to be cropped.
    • getPictureOffsetX

      double getPictureOffsetX()
      Gets the x-axis offset of the image that is to be cropped.
      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureOffsetX(10);
       double pictureOffsetX = crop.getPictureOffsetX();
       
      Returns:
      The x-axis offset of the image that is to be cropped.
    • setPictureOffsetX

      void setPictureOffsetX(double value)
      Sets the x-axis offset of the image that is to be cropped.
      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureOffsetX(100.0);
       
      Parameters:
      value - The x-axis offset of the image that is to be cropped.
    • getPictureOffsetY

      double getPictureOffsetY()
      Gets the y-axis offset of the image that is to be cropped.
      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureOffsetY(10);
       double pictureOffsetY = crop.getPictureOffsetY();
       
      Returns:
      The y-axis offset of the image that is to be cropped.
    • setPictureOffsetY

      void setPictureOffsetY(double value)
      Sets the y-axis offset of the image that is to be cropped.
      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureOffsetY(100.0);
       
      Parameters:
      value - The y-axis offset of the image that is to be cropped.
    • getPictureWidth

      double getPictureWidth()
      Gets the width of the image that is to be cropped.

      This value represents the picture width used by the crop settings.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureWidth(100);
       double pictureWidth = crop.getPictureWidth();
       
      Returns:
      The width of the image that is to be cropped.
    • setPictureWidth

      void setPictureWidth(double value)
      Sets the width of the image that is to be cropped.

      This value represents the picture width used by the crop settings.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setPictureWidth(100.0);
       
      Parameters:
      value - The width of the image that is to be cropped.
    • getShapeHeight

      double getShapeHeight()
      Gets the height of a shape that is used to crop an image.

      Use this method to read the current crop shape height from the ICrop settings.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setShapeHeight(60);
       double shapeHeight = crop.getShapeHeight();
       
      Returns:
      The height of the shape used to crop the image.
    • setShapeHeight

      void setShapeHeight(double value)
      Sets the height of a shape that is used to crop an image.

      Use this method to update the crop shape height in the ICrop settings.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setShapeHeight(100.0);
       
      Parameters:
      value - The height of the shape used to crop the image.
    • getShapeLeft

      double getShapeLeft()
      Gets the location of the left-side of a shape that is used to crop an image.

      Use this method to read the current left position of the cropping shape.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setShapeLeft(10);
       double shapeLeft = crop.getShapeLeft();
       
      Returns:
      The location of the left-side of the shape used to crop the image.
    • setShapeLeft

      void setShapeLeft(double value)
      Sets the location of the left-side of a shape that is used to crop an image.

      Use this method to update the left position of the cropping shape.

      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setShapeLeft(100.0);
       
      Parameters:
      value - The location of the left-side of the shape used to crop the image.
    • getShapeTop

      double getShapeTop()
      Gets the location of the top of a shape that is used to crop an image.
      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setShapeTop(10);
       double shapeTop = crop.getShapeTop();
       
      Returns:
      The location of the top of the shape used to crop the image.
    • setShapeTop

      void setShapeTop(double value)
      Sets the location of the top of a shape that is used to crop an image.
      
       worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
       IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
       ICrop crop = picture.getPictureFormat().getCrop();
       crop.setShapeTop(100.0);
       
      Parameters:
      value - The location of the top of the shape used to crop the image.
    • getShapeWidth

      double getShapeWidth()
      Gets the width of a shape that is used to crop an image.

      Use this method to read the current width configured for the cropping shape.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
       ICrop crop = shape.getFill().getPictureFormat().getCrop();
       crop.setShapeWidth(90);
       double shapeWidth = crop.getShapeWidth();
       
      Returns:
      The width of the shape that is used to crop the image.
    • setShapeWidth

      void setShapeWidth(double value)
      Sets the width of a shape that is used to crop an image.

      Use this method to update the width configured for the cropping shape.

      
       IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 120, 80);
       ICrop crop = shape.getFill().getPictureFormat().getCrop();
       crop.setShapeWidth(100.0);
       
      Parameters:
      value - The width of the shape that is used to crop the image.