[]
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);
doubledoubledoubledoubledoubledoubledoubledoublevoidsetPictureHeight(double value) voidsetPictureOffsetX(double value) voidsetPictureOffsetY(double value) voidsetPictureWidth(double value) voidsetShapeHeight(double value) voidsetShapeLeft(double value) voidsetShapeTop(double value) voidsetShapeWidth(double value) 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();
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);
value - The height 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();
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);
value - 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.setPictureOffsetY(10);
double pictureOffsetY = crop.getPictureOffsetY();
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);
value - The y-axis offset 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();
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);
value - The width of the image that is to be cropped.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();
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);
value - The height of the shape used to crop the 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();
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);
value - The location of the left-side of the shape used to crop the 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();
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);
value - The location of the top of the shape used to crop the 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();
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);
value - The width of the shape that is used to crop the image.