|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.HSSFShape org.apache.poi.hssf.usermodel.HSSFSimpleShape org.apache.poi.hssf.usermodel.HSSFPicture
public class HSSFPicture
Represents a escher picture. Eg. A GIF, JPEG etc...
Field Summary | |
---|---|
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 org.apache.poi.hssf.usermodel.HSSFSimpleShape |
---|
OBJECT_TYPE_ARC, OBJECT_TYPE_COMBO_BOX, OBJECT_TYPE_COMMENT, OBJECT_TYPE_LINE, OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING, OBJECT_TYPE_OVAL, OBJECT_TYPE_PICTURE, OBJECT_TYPE_RECTANGLE, WRAP_BY_POINTS, WRAP_NONE, WRAP_SQUARE |
Constructor Summary | |
---|---|
HSSFPicture(EscherContainerRecord spContainer,
ObjRecord objRecord)
|
|
HSSFPicture(HSSFShape parent,
HSSFAnchor anchor)
Constructs a picture object. |
Method Summary | |
---|---|
protected HSSFShape |
cloneShape()
|
protected EscherContainerRecord |
createSpContainer()
|
HSSFClientAnchor |
getClientAnchor()
|
java.lang.String |
getFileName()
The filename of the embedded image |
java.awt.Dimension |
getImageDimension()
Return the dimension of the embedded image in pixel |
HSSFPictureData |
getPictureData()
Return picture data for this shape |
int |
getPictureIndex()
|
HSSFClientAnchor |
getPreferredSize()
Calculate the preferred size for this picture. |
HSSFClientAnchor |
getPreferredSize(double scale)
Calculate the preferred size for this picture. |
HSSFClientAnchor |
getPreferredSize(double scaleX,
double scaleY)
Calculate the preferred size for this picture. |
HSSFSheet |
getSheet()
|
void |
resize()
Reset the image to the dimension of the embedded image |
void |
resize(double scale)
Resize the image proportionally. |
void |
resize(double scaleX,
double scaleY)
Resize the image |
void |
setFileName(java.lang.String data)
|
void |
setPictureIndex(int pictureIndex)
|
void |
setShapeType(int shapeType)
|
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFSimpleShape |
---|
afterRemove, createObjRecord, createTextObjRecord, getShapeType, getString, getTextObjectRecord, getWrapText, setString, setWrapText |
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFShape |
---|
countOfAllChildren, getAnchor, getEscherContainer, getFillColor, getLineStyle, getLineStyleColor, getLineWidth, getObjRecord, getOptRecord, getParent, getPatriarch, getRotationDegree, isFlipHorizontal, isFlipVertical, isNoFill, setAnchor, setFillColor, setFillColor, setFlipHorizontal, setFlipVertical, setLineStyle, setLineStyleColor, setLineStyleColor, setLineWidth, setNoFill, setParent, setPatriarch, setPropertyValue, setRotationDegree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PICTURE_TYPE_EMF
public static final int PICTURE_TYPE_WMF
public static final int PICTURE_TYPE_PICT
public static final int PICTURE_TYPE_JPEG
public static final int PICTURE_TYPE_PNG
public static final int PICTURE_TYPE_DIB
Constructor Detail |
---|
public HSSFPicture(EscherContainerRecord spContainer, ObjRecord objRecord)
public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
Method Detail |
---|
public int getPictureIndex()
public void setPictureIndex(int pictureIndex)
protected EscherContainerRecord createSpContainer()
createSpContainer
in class HSSFSimpleShape
public void resize()
Please note, that this method works correctly only for workbooks with default font size (Arial 10pt for .xls). If the default font is changed the resized image can be streched vertically or horizontally.
resize
in interface Picture
Picture.resize(double, double)
public void resize(double scale)
resize
in interface Picture
resize(double, double)
public void resize(double scaleX, double scaleY)
Please note, that this method works correctly only for workbooks with default font size (Arial 10pt for .xls). 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
)
resize
in interface Picture
scaleX
- the amount by which the image width is multiplied relative to the original width.scaleY
- the amount by which the image height is multiplied relative to the original height.public HSSFClientAnchor getPreferredSize()
getPreferredSize
in interface Picture
public HSSFClientAnchor getPreferredSize(double scale)
scale
- the amount by which image dimensions are multiplied relative to the original size.
public HSSFClientAnchor getPreferredSize(double scaleX, double scaleY)
getPreferredSize
in interface Picture
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.
public java.awt.Dimension getImageDimension()
getImageDimension
in interface Picture
public HSSFPictureData getPictureData()
getPictureData
in interface Picture
public java.lang.String getFileName()
public void setFileName(java.lang.String data)
public void setShapeType(int shapeType)
setShapeType
in class HSSFSimpleShape
shapeType
- - shapeTypeHSSFShapeTypes
protected HSSFShape cloneShape()
cloneShape
in class HSSFSimpleShape
public HSSFClientAnchor getClientAnchor()
getClientAnchor
in interface Picture
public HSSFSheet getSheet()
getSheet
in interface Picture
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |