Class SXSSFPicture
-
Method Summary
Modifier and TypeMethodDescriptionReturn the underlying CTPicture bean that holds all properties for this pictureReturn the dimension of the embedded image in pixelReturn 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.getSheet()
boolean
isNoFill()
Whether this shape is not filled with a colorvoid
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.
-
Method Details
-
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:
getPreferredSize
in 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
-
getPictureData
Return picture data for this shape- Specified by:
getPictureData
in interfacePicture
- Returns:
- picture data for this shape
-
getAnchor
-
resize
public void resize(double scaleX, double scaleY) Description copied from interface:Picture
Resize 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:Picture
Calculate the preferred size for this picture.- Specified by:
getPreferredSize
in 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:Picture
Return the dimension of the embedded image in pixel- Specified by:
getImageDimension
in interfacePicture
- Returns:
- image dimension in pixels
-
getClientAnchor
- Specified by:
getClientAnchor
in interfacePicture
- Returns:
- the anchor that is used by this picture
-
getDrawing
-
getSheet
-
getShapeName
- Specified by:
getShapeName
in interfaceShape
- Returns:
- the name of this shape
-
getParent
-
isNoFill
public boolean isNoFill()Description copied from interface:Shape
Whether this shape is not filled with a color -
setNoFill
public void setNoFill(boolean noFill) Description copied from interface:Shape
Sets whether this shape is filled or transparent. -
setFillColor
public void setFillColor(int red, int green, int blue) Description copied from interface:Shape
Sets the color used to fill this shape using the solid fill pattern.- Specified by:
setFillColor
in interfaceShape
-
setLineStyleColor
public void setLineStyleColor(int red, int green, int blue) Description copied from interface:Shape
The color applied to the lines of this shape.- Specified by:
setLineStyleColor
in interfaceShape
-