Modifier | Constructor and Description |
---|---|
protected |
XSSFPicture(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture ctPicture)
Construct a new XSSFPicture object.
(构造一个新的 XSSFPicture 对象。)
|
Modifier and Type | Method and Description |
---|---|
XSSFClientAnchor |
getClientAnchor() |
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture |
getCTPicture()
Return the underlying CTPicture bean that holds all properties for this picture
(返回包含此图片所有属性的底层 CTPicture bean)
|
java.awt.Dimension |
getImageDimension()
Return the dimension of the embedded image in pixel
(返回嵌入图像的尺寸(以像素为单位))
|
protected static java.awt.Dimension |
getImageDimension(PackagePart part, int type)
Return the dimension of this image
(返回此图像的尺寸)
|
XSSFPictureData |
getPictureData()
Return picture data for this shape
(返回此形状的图片数据)
|
XSSFClientAnchor |
getPreferredSize()
Calculate the preferred size for this picture.
(计算这张图片的首选尺寸。)
|
XSSFClientAnchor |
getPreferredSize(double scale)
Calculate the preferred size for this picture.
(计算这张图片的首选尺寸。)
|
XSSFClientAnchor |
getPreferredSize(double scaleX, double scaleY)
Calculate the preferred size for this picture.
(计算这张图片的首选尺寸。)
|
java.lang.String |
getShapeName() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties |
getShapeProperties()
Returns xml bean with shape properties.
(返回具有形状属性的 xml bean。)
|
XSSFSheet |
getSheet() |
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture |
prototype()
Returns a prototype that is used to construct new shapes
(返回用于构造新形状的原型)
|
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 relatively to its current size.
(相对于其当前大小调整图像大小。)
|
protected void |
setPictureReference(PackageRelationship rel)
Link this shape with the picture data
(将此形状与图片数据链接)
|
getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFill
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnchor, getParent, isNoFill, setFillColor, setLineStyleColor, setNoFill
protected XSSFPicture(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture ctPicture)
XSSFDrawing.createPicture(XSSFClientAnchor, int)
(构造一个新的 XSSFPicture 对象。从 XSSFDrawing.createPicture(XSSFClientAnchor, int) 调用此构造函数)
drawing
- the XSSFDrawing that owns this picture
(drawing - 拥有这张图片的 XSSFDrawing)
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture prototype()
protected void setPictureReference(PackageRelationship rel)
rel
- relationship referring the picture data
(rel - 引用图片数据的关系)
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture getCTPicture()
public void resize()
resize
in interface
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 the default font size (Calibri 11pt for .xlsx). 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, when set to
Double.MAX_VALUE
the width of the embedded image is used
(scaleX - 图像宽度与原始宽度相乘的数量,当设置为 Double.MAX_VALUE 时,使用嵌入图像的宽度)
scaleY
- the amount by which the image height is multiplied relative to the original height, when set to
Double.MAX_VALUE
the height of the embedded image is used
(scaleY - 图像高度相对于原始高度的乘积,当设置为 Double.MAX_VALUE 时,使用嵌入图像的高度)
public XSSFClientAnchor getPreferredSize()
getPreferredSize
in interface
Picture
(接口图片中的getPreferredSize)
public XSSFClientAnchor getPreferredSize(double scale)
scale
- the amount by which image dimensions are multiplied relative to the original size.
(scale - 图像尺寸与原始尺寸相乘的数量。)
public XSSFClientAnchor 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 - 图像高度相对于原始高度的乘积量。)
protected static java.awt.Dimension getImageDimension(PackagePart part, int type)
part
- the package part holding raw picture data
(part - 包含原始图片数据的包部分)
type
- type of the picture:
Workbook.PICTURE_TYPE_JPEG
,
Workbook.PICTURE_TYPE_PNG
or
Workbook.PICTURE_TYPE_DIB
(type - 图片的类型:Workbook.PICTURE_TYPE_JPEG、Workbook.PICTURE_TYPE_PNG 或 Workbook.PICTURE_TYPE_DIB)
public java.awt.Dimension getImageDimension()
getImageDimension
in interface
Picture
(接口图片中的getImageDimension)
public XSSFPictureData getPictureData()
getPictureData
in interface
Picture
(接口图片中的getPictureData)
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
XSSFShape
getShapeProperties
in class
XSSFShape
(XSSFShape 类中的 getShapeProperties)
public XSSFClientAnchor getClientAnchor()
getClientAnchor
in interface
Picture
(接口图片中的getClientAnchor)
public XSSFSheet getSheet()
public java.lang.String getShapeName()
getShapeName
in interface
Shape
(接口 Shape 中的 getShapeName)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.