[]
IContainer, IShapeAn IBackgroundPicture is a shape in the IBackgroundPictures collection returned by IWorksheet.getBackgroundPictures(). In addition to the members inherited from IShape, it provides background-picture-specific settings such as transparency, image layout, and corner radius.
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
picture.setTransparency(0.25);
picture.setBackgroundImageLayout(ImageLayout.Center);
intdoublevoidvoidsetCornerRadius(int value) voidsetTransparency(double value) getHeight, getHeightInPixel, getLeft, getLeftInPixel, getTop, getTopInPixel, getWidth, getWidthInPixel, setHeight, setHeightInPixel, setLeft, setLeftInPixel, setTop, setTopInPixel, setWidth, setWidthInPixeldelete, duplicate, fromJson, getAdjustments, getAlternativeText, getAutoShapeType, getBottomRightCell, getChart, getConnector, getConnectorFormat, getControl, getDecorative, getFill, getFormula, getGroupItems, getHasChart, getHyperlink, getIsPrintable, getLine, getLocked, getName, getParent, getParentGroup, getPictureFormat, getPlacement, getRotation, getTextFrame, getThreeD, getTitle, getTopLeftCell, getType, getVisible, getZOrderPosition, setAlternativeText, setAutoShapeType, setDecorative, setFormula, setIsPrintable, setLocked, setName, setPlacement, setRotation, setTitle, setVisible, toImage, toImage, toImage, toImage, toJson, ungroup, zOrder
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
picture.setTransparency(0.25);
double transparency = picture.getTransparency();
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
picture.setTransparency(0.6);
value - The degree of transparency of the picture, from 0.0 for a fully opaque picture to 1.0 for a fully clear picture.The returned ImageLayout value controls how the background picture is arranged within its destination rectangle, such as centered, stretched, zoomed, or tiled.
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
picture.setBackgroundImageLayout(ImageLayout.Center);
ImageLayout layout = picture.getBackgroundImageLayout();
The specified ImageLayout controls how the background picture is arranged within its destination rectangle, such as centered, stretched, zoomed, or tiled.
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
picture.setBackgroundImageLayout(ImageLayout.Center);
value - The background image layout to apply.This value applies to the rectangular clipping shape used by the background picture. A larger value produces more rounded corners.
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
int cornerRadius = picture.getCornerRadius();
This value applies to the rectangular clipping shape used by the background picture. A larger value produces more rounded corners.
IBackgroundPictures backgroundPictures = worksheet.getBackgroundPictures();
try (InputStream stream = createSampleImageStream()) {
backgroundPictures.addPicture(stream, ImageType.PNG, 12, 18, 120, 80);
}
IBackgroundPicture picture = backgroundPictures.get(0);
picture.setCornerRadius(0);
value - The corner radius of the rectangular die-cut, in pixels.