Class SXSSFPicture
-
Method Summary
Modifier and TypeMethodDescriptionorg.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPictureReturn the underlying CTPicture bean that holds all properties for this pictureReturn the dimension of the embedded image in pixelprotected static DimensiongetImageDimension(PackagePart part, int type) Return the dimension of this imageReturn picture data for this shapeCalculate the preferred size for this picture.getPreferredSize(double scale) Calculate the preferred size for this picture.getPreferredSize(double scaleX, double scaleY) Calculate the preferred size for this picture.protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapePropertiesgetSheet()booleanisNoFill()Whether this shape is not filled with a colorvoidresize()Reset the image to the original size.voidresize(double scale) Reset the image to the original size.voidresize(double scaleX, double scaleY) Resize the image.voidsetFillColor(int red, int green, int blue) Sets the color used to fill this shape using the solid fill pattern.voidsetLineStyleColor(int red, int green, int blue) The color applied to the lines of this shape.voidsetNoFill(boolean noFill) Sets whether this shape is filled or transparent.
-
Method Details
-
getCTPicture
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture getCTPicture()Return the underlying CTPicture bean that holds all properties for this picture- Returns:
- the underlying CTPicture bean
-
resize
public void resize()Reset the image to the original size.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
public void resize(double scale) Reset the image to the original size.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.
-
getPreferredSize
Calculate the preferred size for this picture.- Specified by:
getPreferredSizein interfacePicture- Returns:
- XSSFClientAnchor with the preferred size for this image
-
getPreferredSize
Calculate the preferred size for this picture.- Parameters:
scale- the amount by which image dimensions are multiplied relative to the original size.- Returns:
- XSSFClientAnchor with the preferred size for this image
-
getImageDimension
Return the dimension of this image- Parameters:
part- the package part holding raw picture datatype- type of the picture:Workbook.PICTURE_TYPE_JPEG,Workbook.PICTURE_TYPE_PNGorWorkbook.PICTURE_TYPE_DIB- Returns:
- image dimension in pixels
-
getPictureData
Return picture data for this shape- Specified by:
getPictureDatain interfacePicture- Returns:
- picture data for this shape
-
getShapeProperties
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties() -
getAnchor
-
resize
public void resize(double scaleX, double scaleY) Description copied from interface:PictureResize the image.Please 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) -
getPreferredSize
Description copied from interface:PictureCalculate the preferred size for this picture.- Specified by:
getPreferredSizein interfacePicture- Parameters:
scaleX- 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.- Returns:
- ClientAnchor with the preferred size for this image
-
getImageDimension
Description copied from interface:PictureReturn the dimension of the embedded image in pixel- Specified by:
getImageDimensionin interfacePicture- Returns:
- image dimension in pixels
-
getClientAnchor
- Specified by:
getClientAnchorin interfacePicture- Returns:
- the anchor that is used by this picture
-
getDrawing
-
getSheet
-
getShapeName
- Specified by:
getShapeNamein interfaceShape- Returns:
- the name of this shape
-
getParent
-
isNoFill
public boolean isNoFill()Description copied from interface:ShapeWhether this shape is not filled with a color -
setNoFill
public void setNoFill(boolean noFill) Description copied from interface:ShapeSets whether this shape is filled or transparent. -
setFillColor
public void setFillColor(int red, int green, int blue) Description copied from interface:ShapeSets the color used to fill this shape using the solid fill pattern.- Specified by:
setFillColorin interfaceShape
-
setLineStyleColor
public void setLineStyleColor(int red, int green, int blue) Description copied from interface:ShapeThe color applied to the lines of this shape.- Specified by:
setLineStyleColorin interfaceShape
-