Package org.apache.poi.xssf.streaming
Class SXSSFPicture
java.lang.Object
org.apache.poi.xssf.streaming.SXSSFPicture
Streaming version of Picture.
Most of the code is a copy of the non-streaming XSSFPicture code.
This is necessary as a private method getRowHeightInPixels of that class needs to be changed, which is called by a method call chain nested several levels.
The main change is to access the rows in the SXSSF sheet, not the always empty rows in the XSSF sheet when checking the row heights.
-
Method Summary
Modifier and TypeMethodDescriptionorg.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPictureReturn the underlying CTPicture bean that holds all properties for this pictureprotected 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) protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapePropertiesgetSheet()booleanisNoFill()voidresize()Reset the image to the original size.voidresize(double scale) Reset the image to the original size.voidresize(double scaleX, double scaleY) voidsetFillColor(int red, int green, int blue) voidsetLineStyleColor(int red, int green, int blue) voidsetNoFill(boolean noFill)
-
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 stretched 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 stretched 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) -
getPreferredSize
- Specified by:
getPreferredSizein interfacePicture
-
getImageDimension
- Specified by:
getImageDimensionin interfacePicture
-
getClientAnchor
- Specified by:
getClientAnchorin interfacePicture
-
getDrawing
-
getSheet
-
getShapeName
- Specified by:
getShapeNamein interfaceShape
-
getParent
-
isNoFill
public boolean isNoFill() -
setNoFill
public void setNoFill(boolean noFill) -
setFillColor
public void setFillColor(int red, int green, int blue) - Specified by:
setFillColorin interfaceShape
-
setLineStyleColor
public void setLineStyleColor(int red, int green, int blue) - Specified by:
setLineStyleColorin interfaceShape
-