public class HSSFPicture extends HSSFSimpleShape implements Picture
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
FILL__FILLCOLOR_DEFAULT, LINESTYLE__COLOR_DEFAULT, LINESTYLE_DASHDOTDOTSYS, LINESTYLE_DASHDOTGEL, LINESTYLE_DASHDOTSYS, LINESTYLE_DASHGEL, LINESTYLE_DASHSYS, LINESTYLE_DEFAULT, LINESTYLE_DOTGEL, LINESTYLE_DOTSYS, LINESTYLE_LONGDASHDOTDOTGEL, LINESTYLE_LONGDASHDOTGEL, LINESTYLE_LONGDASHGEL, LINESTYLE_NONE, LINESTYLE_SOLID, LINEWIDTH_DEFAULT, LINEWIDTH_ONE_PT, NO_FILL_DEFAULT, NO_FILLHITTEST_FALSE, NO_FILLHITTEST_TRUE
Constructor and Description |
---|
HSSFPicture(EscherContainerRecord spContainer, ObjRecord objRecord) |
HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
Constructs a picture object.
|
Modifier and Type | Method and Description |
---|---|
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) |
afterRemove, createObjRecord, createTextObjRecord, getShapeId, getShapeType, getString, getTextObjectRecord, getWrapText, setString, setWrapText
countOfAllChildren, getAnchor, getEscherContainer, getFillColor, getLineStyle, getLineStyleColor, getLineWidth, getObjRecord, getOptRecord, getParent, getPatriarch, getRotationDegree, getShapeName, isFlipHorizontal, isFlipVertical, isNoFill, setAnchor, setFillColor, setFillColor, setFlipHorizontal, setFlipVertical, setLineStyle, setLineStyleColor, setLineStyleColor, setLineWidth, setNoFill, setParent, setPatriarch, setPropertyValue, setRotationDegree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnchor, getParent, getShapeName, isNoFill, setFillColor, setLineStyleColor, setNoFill
public HSSFPicture(EscherContainerRecord spContainer, ObjRecord objRecord)
public HSSFPicture(HSSFShape parent, HSSFAnchor anchor)
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.
(将图像重置为嵌入图像的尺寸 请注意,此方法仅适用于具有默认字体大小的工作簿(.xls 为 Arial 10pt)。如果更改默认字体,则可以垂直或水平拉伸调整大小的图像。)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.
(scaleX - 图像宽度与原始宽度相乘的数量。)
scaleY
- the amount by which the image height is multiplied relative to the original height.
(scaleY - 图像高度相对于原始高度的乘积。)
public HSSFClientAnchor getPreferredSize()
getPreferredSize
in interface
Picture
(接口图片中的getPreferredSize)
public HSSFClientAnchor getPreferredSize(double scale)
scale
- the amount by which image dimensions are multiplied relative to the original size.
(scale - 图像尺寸与原始尺寸相乘的数量。)
public HSSFClientAnchor getPreferredSize(double scaleX, double scaleY)
getPreferredSize
in interface
Picture
(接口图片中的getPreferredSize)
scaleX
- the amount by which image width is multiplied relative to the original width.
(scaleX - 图像宽度与原始宽度相乘的数量。)
scaleY
- the amount by which image height is multiplied relative to the original height.
(scaleY - 图像高度相对于原始高度的乘积量。)
public java.awt.Dimension getImageDimension()
getImageDimension
in interface
Picture
(接口图片中的getImageDimension)
public HSSFPictureData getPictureData()
getPictureData
in interface
Picture
(接口图片中的getPictureData)
null
if picture wasn't embedded, i.e. external linked
(此形状的图片数据或 null 如果图片未嵌入,即外部链接)
public java.lang.String getFileName()
public void setFileName(java.lang.String data)
public void setShapeType(int shapeType)
setShapeType
in class
HSSFSimpleShape
shapeType
- - shapeType
(形状类型 - - 形状类型)
HSSFShapeTypes
protected HSSFShape cloneShape()
cloneShape
in class
HSSFSimpleShape
public HSSFClientAnchor getClientAnchor()
getClientAnchor
in interface
Picture
(接口图片中的getClientAnchor)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.