Class SXSSFPicture

  • All Implemented Interfaces:
    Picture, Shape

    public final class SXSSFPicture
    extends Object
    implements Picture
    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 Detail

      • 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.

        Specified by:
        resize in interface Picture
      • 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.

        Specified by:
        resize in interface Picture
        Parameters:
        scale - 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.
      • getPreferredSize

        public XSSFClientAnchor getPreferredSize()
        Calculate the preferred size for this picture.
        Specified by:
        getPreferredSize in interface Picture
        Returns:
        XSSFClientAnchor with the preferred size for this image
      • getPreferredSize

        public XSSFClientAnchor getPreferredSize​(double scale)
        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

        public XSSFPictureData getPictureData()
        Return picture data for this shape
        Specified by:
        getPictureData in interface Picture
        Returns:
        picture data for this shape
      • getShapeProperties

        protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
      • resize

        public void resize​(double scaleX,
                           double scaleY)
        Specified by:
        resize in interface Picture
      • isNoFill

        public boolean isNoFill()
        Specified by:
        isNoFill in interface Shape
      • setNoFill

        public void setNoFill​(boolean noFill)
        Specified by:
        setNoFill in interface Shape
      • setFillColor

        public void setFillColor​(int red,
                                 int green,
                                 int blue)
        Specified by:
        setFillColor in interface Shape
      • setLineStyleColor

        public void setLineStyleColor​(int red,
                                      int green,
                                      int blue)
        Specified by:
        setLineStyleColor in interface Shape