public final class SXSSFPicture extends java.lang.Object implements Picture
| Modifier and Type | Method and Description |
|---|---|
XSSFAnchor |
getAnchor() |
XSSFClientAnchor |
getClientAnchor() |
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture |
getCTPicture()
Return the underlying CTPicture bean that holds all properties for this picture
|
XSSFDrawing |
getDrawing() |
java.awt.Dimension |
getImageDimension()
Return the dimension of the embedded image in pixel
|
protected static java.awt.Dimension |
getImageDimension(PackagePart part,
int type)
Return the dimension of this image
|
Shape |
getParent() |
XSSFPictureData |
getPictureData()
Return picture data for this shape
|
XSSFClientAnchor |
getPreferredSize()
Calculate the preferred size for this picture.
|
XSSFClientAnchor |
getPreferredSize(double scale)
Calculate the preferred size for this picture.
|
XSSFClientAnchor |
getPreferredSize(double scaleX,
double scaleY)
Calculate the preferred size for this picture.
|
java.lang.String |
getShapeName() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties |
getShapeProperties() |
XSSFSheet |
getSheet() |
boolean |
isNoFill()
Whether this shape is not filled with a color
|
void |
resize()
Reset the image to the original size.
|
void |
resize(double scale)
Reset the image to the original size.
|
void |
resize(double scaleX,
double scaleY)
Resize the image.
|
void |
setFillColor(int red,
int green,
int blue)
Sets the color used to fill this shape using the solid fill pattern.
|
void |
setLineStyleColor(int red,
int green,
int blue)
The color applied to the lines of this shape.
|
void |
setNoFill(boolean noFill)
Sets whether this shape is filled or transparent.
|
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture getCTPicture()
public void resize()
Please note, that this method works correctly only for workbooks with the default font size (Calibri 11pt for .xlsx). If the default font is changed the resized image can be streched vertically or horizontally.
resize in interface PicturePicture.resize(double, double)public void resize(double scale)
Please note, that this method works correctly only for workbooks with the default font size (Calibri 11pt for .xlsx). If the default font is changed the resized image can be streched vertically or horizontally.
resize in interface Picturescale - the amount by which image dimensions are multiplied relative to the original size.
resize(1.0) sets the original size, resize(0.5) resize to 50% of the original,
resize(2.0) resizes to 200% of the original.Picture.resize(double, double)public XSSFClientAnchor getPreferredSize()
getPreferredSize in interface Picturepublic XSSFClientAnchor getPreferredSize(double scale)
scale - the amount by which image dimensions are multiplied relative to the original size.protected static java.awt.Dimension getImageDimension(PackagePart part, int type)
part - the package part holding raw picture datatype - type of the picture: Workbook.PICTURE_TYPE_JPEG,
Workbook.PICTURE_TYPE_PNG or Workbook.PICTURE_TYPE_DIBpublic XSSFPictureData getPictureData()
getPictureData in interface Pictureprotected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
public XSSFAnchor getAnchor()
public void resize(double scaleX,
double scaleY)
PicturePlease note, that this method works correctly only for workbooks with the default font size (Arial 10pt for .xls and Calibri 11pt for .xlsx). If the default font is changed the resized image can be streched vertically or horizontally.
resize(1.0,1.0) keeps the original size,
resize(0.5,0.5) resize to 50% of the original,
resize(2.0,2.0) resizes to 200% of the original.
resize( resizes to the dimension of the embedded image.
Double.MAX_VALUE,Double.MAX_VALUE)
public XSSFClientAnchor getPreferredSize(double scaleX, double scaleY)
PicturegetPreferredSize in interface PicturescaleX - the amount by which image width is multiplied relative to the original width.scaleY - the amount by which image height is multiplied relative to the original height.public java.awt.Dimension getImageDimension()
PicturegetImageDimension in interface Picturepublic XSSFClientAnchor getClientAnchor()
getClientAnchor in interface Picturepublic XSSFDrawing getDrawing()
public XSSFSheet getSheet()
public java.lang.String getShapeName()
getShapeName in interface Shapepublic Shape getParent()
public boolean isNoFill()
Shapepublic void setNoFill(boolean noFill)
Shapepublic void setFillColor(int red,
int green,
int blue)
ShapesetFillColor in interface Shapepublic void setLineStyleColor(int red,
int green,
int blue)
ShapesetLineStyleColor in interface ShapeCopyright 2018 The Apache Software Foundation or its licensors, as applicable.