| Modifier | Constructor and Description |
|---|---|
protected |
XSSFPicture(XSSFDrawing drawing,
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture ctPicture)
Construct a new XSSFPicture object.
|
| Modifier and Type | Method and Description |
|---|---|
XSSFClientAnchor |
getClientAnchor() |
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture |
getCTPicture()
Return the underlying CTPicture bean that holds all properties for this picture
|
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
|
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()
Returns xml bean with shape properties.
|
XSSFSheet |
getSheet() |
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture |
prototype()
Returns a prototype that is used to construct new shapes
|
void |
resize()
Reset the image to the dimension of the embedded image
|
void |
resize(double scale)
Resize the image proportionally.
|
void |
resize(double scaleX,
double scaleY)
Resize the image relatively to its current size.
|
protected void |
setPictureReference(PackageRelationship rel)
Link this shape with the picture data
|
getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFillclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAnchor, getParent, isNoFill, setFillColor, setLineStyleColor, setNoFillprotected XSSFPicture(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture ctPicture)
XSSFDrawing.createPicture(XSSFClientAnchor, int)drawing - the XSSFDrawing that owns this pictureprotected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture prototype()
protected void setPictureReference(PackageRelationship rel)
rel - relationship referring the picture data@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture getCTPicture()
public void resize()
resize in interface Pictureresize(double, double)public void resize(double scale)
resize in interface Pictureresize(double, double)public void resize(double scaleX,
double scaleY)
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(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)
resize in interface PicturescaleX - the amount by which the image width is multiplied relative to the original width,
when set to Double.MAX_VALUE the width of the embedded image is usedscaleY - the amount by which the image height is multiplied relative to the original height,
when set to Double.MAX_VALUE the height of the embedded image is usedpublic XSSFClientAnchor getPreferredSize()
getPreferredSize in interface Picturepublic XSSFClientAnchor getPreferredSize(double scale)
scale - the amount by which image dimensions are multiplied relative to the original size.public XSSFClientAnchor getPreferredSize(double scaleX, double scaleY)
getPreferredSize 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.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 java.awt.Dimension getImageDimension()
getImageDimension in interface Picturepublic XSSFPictureData getPictureData()
getPictureData in interface Pictureprotected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
XSSFShapegetShapeProperties in class XSSFShapepublic XSSFClientAnchor getClientAnchor()
getClientAnchor in interface Picturepublic XSSFSheet getSheet()
public java.lang.String getShapeName()
getShapeName in interface ShapeCopyright 2021 The Apache Software Foundation or its licensors, as applicable.