[]
This interface provides access to picture-specific properties such as brightness, contrast, transparency, color transformation, cropping, image data, and linked picture settings. An IPictureFormat object is typically obtained from IShape.getPictureFormat() and applies to both regular pictures and linked pictures.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setTransparentBackground(true);
pictureFormat.setTransparency(0.5);
doubledoublegetCrop()ICrop object that represents the cropping settings for the specified IPictureFormat object.doubledoubledoubledoublebyte[]getFill()doublebooleangetType()getUrl()voidsetBrightness(double value) voidsetColorType(PictureColorType value) voidsetContrast(double value) voidsetCropBottom(double value) voidsetCropLeft(double value) voidsetCropRight(double value) voidsetCropTop(double value) voidsetFill(byte[] bytes) voidsetReference(String value) voidsetTransparency(double value) voidsetTransparentBackground(boolean value) The returned value is a number from 0.0 (dimmest) to 1.0 (brightest).
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setBrightness(0.6);
double brightness = picture.getPictureFormat().getBrightness();
0.0 (dimmest) to 1.0 (brightest).The returned value is a number from 0.0 (dimmest) to 1.0 (brightest).
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setBrightness(0.6);
value - The brightness of the specified picture or OLE object, from 0.0 (dimmest) to 1.0 (brightest).The returned value indicates whether the picture uses the default color transformation or a specific transformation such as PictureColorType.Grayscale, PictureColorType.BlackAndWhite, or PictureColorType.Watermark.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setColorType(PictureColorType.Grayscale);
PictureColorType colorType = picture.getPictureFormat().getColorType();
Use this method to apply a predefined picture color transformation such as PictureColorType.Grayscale, PictureColorType.BlackAndWhite, or PictureColorType.Watermark.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setColorType(PictureColorType.Grayscale);
value - The color transformation type to apply to the picture.The returned value is a number from 0.0 (the least contrast) to 1.0 (the greatest contrast).
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setContrast(0.6);
double contrast = picture.getPictureFormat().getContrast();
0.0 (the least contrast) to 1.0 (the greatest contrast).The returned value is a number from 0.0 (the least contrast) to 1.0 (the greatest contrast).
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setContrast(0.6);
value - The contrast of the specified picture or OLE object, from 0.0 (the least contrast) to 1.0 (the greatest contrast).ICrop object that represents the cropping settings for the specified IPictureFormat object.Use the returned object to access or modify image cropping properties such as the source image size, image offsets, and the visible area of the picture.
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
ICrop crop = pictureFormat.getCrop();
crop.setPictureOffsetX(10);
ICrop object that represents the cropping settings for the specified IPictureFormat object.Use this property to determine how much of the source image is hidden from the bottom edge of the picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setCropBottom(8);
double cropBottom = picture.getPictureFormat().getCropBottom();
Use this property to set how much of the source image is hidden from the bottom edge of the picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setCropBottom(8);
picture.getPictureFormat().setCropBottom(100.0);
value - The number of points that are cropped off the bottom of the specified picture.Use this property to determine how much of the source image is hidden from the left edge of the picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setCropLeft(8);
double cropLeft = picture.getPictureFormat().getCropLeft();
Use this property to set how much of the source image is hidden from the left edge of the picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
picture.getPictureFormat().setCropLeft(8);
picture.getPictureFormat().setCropLeft(100.0);
value - The number of points that are cropped off the left side of the specified picture.Use this method to retrieve the current right-side crop amount that was applied to the picture format, such as through setCropRight(double).
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setCropRight(12);
double cropRight = pictureFormat.getCropRight();
worksheet.getRange("A1:B2").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setCropRight(12);
value - The number of points that are cropped off the right side of the specified picture.Use setCropTop(double) to change this cropping value.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setCropTop(10);
double cropTop = pictureFormat.getCropTop();
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setCropTop(10);
value - The number of points that are cropped off the top of the picture.Use setFill(byte[]) to replace the picture data.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
byte[] pictureBytes = pictureFormat.getFill();
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setFill(value);
bytes - The byte array of the specified picture.Use this method to determine the picture format, such as PNG, JPG, or SVG, for a picture shape.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
ImageType type = pictureFormat.getType();
The returned value ranges from 0.0 for a fully opaque picture to 1.0 for a fully clear picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setTransparency(0.25);
double transparency = pictureFormat.getTransparency();
0.0 for fully opaque to 1.0 for fully clear.The returned value ranges from 0.0 for a fully opaque picture to 1.0 for a fully clear picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setTransparency(0.25);
value - The degree of transparency of the specified picture, from 0.0 for fully opaque to 1.0 for fully clear.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
String url = pictureFormat.getUrl();
For a linked picture created from a cell range, the returned string identifies the source reference used by the picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
String reference = pictureFormat.getReference();
For a linked picture created from a cell range, the returned string identifies the source reference used by the picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setReference("=$A$1");
value - The reference string of the current picture.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setTransparentBackground(true);
boolean transparentBackground = pictureFormat.getTransparentBackground();
true if the picture format uses a transparent background; otherwise, false.
worksheet.getRange("A1:B2").setValue(new Object[][] {{"Name", "Value"}, {"Test", 100}});
IShape picture = worksheet.getShapes().addCameraPicture("=$A$1:$B$2", 20, 20);
IPictureFormat pictureFormat = picture.getPictureFormat();
pictureFormat.setTransparentBackground(true);
value - true if the picture format uses a transparent background; otherwise, false.