Package loci.poi.hssf.usermodel
Class HSSFPicture
- java.lang.Object
-
- loci.poi.hssf.usermodel.HSSFShape
-
- loci.poi.hssf.usermodel.HSSFSimpleShape
-
- loci.poi.hssf.usermodel.HSSFPicture
-
public class HSSFPicture extends HSSFSimpleShape
Represents a escher picture. Eg. A GIF, JPEG etc...- Author:
- Glen Stampoultzis, Yegor Kozlov (yegor at apache.org)
-
-
Field Summary
Fields Modifier and Type Field Description static int
PICTURE_TYPE_DIB
static int
PICTURE_TYPE_EMF
static int
PICTURE_TYPE_JPEG
static int
PICTURE_TYPE_PICT
static int
PICTURE_TYPE_PNG
static int
PICTURE_TYPE_WMF
-
Fields inherited from class loci.poi.hssf.usermodel.HSSFSimpleShape
OBJECT_TYPE_COMMENT, OBJECT_TYPE_LINE, OBJECT_TYPE_OVAL, OBJECT_TYPE_PICTURE, OBJECT_TYPE_RECTANGLE
-
Fields inherited from class loci.poi.hssf.usermodel.HSSFShape
LINESTYLE_DASHDOTDOTSYS, LINESTYLE_DASHDOTGEL, LINESTYLE_DASHDOTSYS, LINESTYLE_DASHGEL, LINESTYLE_DASHSYS, LINESTYLE_DOTGEL, LINESTYLE_DOTSYS, LINESTYLE_LONGDASHDOTDOTGEL, LINESTYLE_LONGDASHDOTGEL, LINESTYLE_LONGDASHGEL, LINESTYLE_NONE, LINESTYLE_SOLID, LINEWIDTH_DEFAULT, LINEWIDTH_ONE_PT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPictureIndex()
HSSFClientAnchor
getPreferredSize()
Calculate the preferred size for this picture.protected int[]
getResolution(ImageReader r)
The metadata of PNG and JPEG can contain the width of a pixel in millimeters.void
resize()
Reset the image to the original size.void
setPictureIndex(int pictureIndex)
-
Methods inherited from class loci.poi.hssf.usermodel.HSSFSimpleShape
getShapeType, setShapeType
-
Methods inherited from class loci.poi.hssf.usermodel.HSSFShape
countOfAllChildren, getAnchor, getFillColor, getLineStyle, getLineStyleColor, getLineWidth, getParent, isNoFill, setAnchor, setFillColor, setFillColor, setLineStyle, setLineStyleColor, setLineStyleColor, setLineWidth, setNoFill
-
-
-
-
Field Detail
-
PICTURE_TYPE_EMF
public static final int PICTURE_TYPE_EMF
- See Also:
- Constant Field Values
-
PICTURE_TYPE_WMF
public static final int PICTURE_TYPE_WMF
- See Also:
- Constant Field Values
-
PICTURE_TYPE_PICT
public static final int PICTURE_TYPE_PICT
- See Also:
- Constant Field Values
-
PICTURE_TYPE_JPEG
public static final int PICTURE_TYPE_JPEG
- See Also:
- Constant Field Values
-
PICTURE_TYPE_PNG
public static final int PICTURE_TYPE_PNG
- See Also:
- Constant Field Values
-
PICTURE_TYPE_DIB
public static final int PICTURE_TYPE_DIB
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPictureIndex
public int getPictureIndex()
-
setPictureIndex
public void setPictureIndex(int pictureIndex)
-
resize
public void resize()
Reset the image to the original size.- Since:
- POI 3.0.2
-
getPreferredSize
public HSSFClientAnchor getPreferredSize()
Calculate the preferred size for this picture.- Returns:
- HSSFClientAnchor with the preferred size for this image
- Since:
- POI 3.0.2
-
getResolution
protected int[] getResolution(ImageReader r) throws IOException
The metadata of PNG and JPEG can contain the width of a pixel in millimeters. Return the the "effective" dpi calculated as25.4/HorizontalPixelSize
and25.4/VerticalPixelSize
. Where 25.4 is the number of mm in inch.- Returns:
- array of two elements:
{horisontalPdi, verticalDpi}
. {96, 96} is the default. - Throws:
IOException
-
-