public final class SXSSFPicture extends java.lang.Object implements Picture
Modifier and Type | Method and Description |
---|---|
XSSFAnchor |
getAnchor() |
XSSFClientAnchor |
getClientAnchor() |
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture |
getCTPicture()
Return the underlying CTPicture bean that holds all properties for this picture
(返回包含此图片所有属性的底层 CTPicture bean)
|
XSSFDrawing |
getDrawing() |
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
(返回此图像的尺寸)
|
Shape |
getParent() |
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() |
XSSFSheet |
getSheet() |
boolean |
isNoFill()
Whether this shape is not filled with a color
(这个形状是否没有填充颜色)
|
void |
resize()
Reset the image to the original size.
(将图像重置为原始大小。)
|
void |
resize(double scale)
Reset the image to the original size.
(将图像重置为原始大小。)
|
void |
resize(double scaleX, double scaleY)
Resize the image.
(调整图像大小。)
|
void |
setFillColor(int red, int green, int blue)
Sets the color used to fill this shape using the solid fill pattern.
(使用实心填充图案设置用于填充此形状的颜色。)
|
void |
setLineStyleColor(int red, int green, int blue)
The color applied to the lines of this shape.
(应用于此形状的线条的颜色。)
|
void |
setNoFill(boolean noFill)
Sets whether this shape is filled or transparent.
(设置此形状是填充的还是透明的。)
|
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTPicture getCTPicture()
public void resize()
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.
(将图像重置为原始大小。请注意,此方法仅适用于具有默认字体大小的工作簿(Calibri 11pt for .xlsx)。如果更改默认字体,则可以垂直或水平拉伸调整大小的图像。)resize
in interface
Picture
(在界面图片中调整大小)
Picture.resize(double, double)
public void resize(double scale)
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.
(将图像重置为原始大小。请注意,此方法仅适用于具有默认字体大小的工作簿(Calibri 11pt for .xlsx)。如果更改默认字体,则可以垂直或水平拉伸调整大小的图像。)resize
in interface
Picture
(在界面图片中调整大小)
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.
(scale - 图像尺寸与原始尺寸相乘的数量。 resize(1.0) 设置原始大小,resize(0.5) 调整为原始大小的 50%,resize(2.0) 调整为原始大小的 200%。)
Picture.resize(double, double)
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 - 图像尺寸与原始尺寸相乘的数量。)
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 XSSFPictureData getPictureData()
getPictureData
in interface
Picture
(接口图片中的getPictureData)
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
public XSSFAnchor getAnchor()
public void resize(double scaleX, double scaleY)
Picture
Please note, that this method works correctly only for workbooks with the default font size (Arial 10pt for .xls and 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.
(scaleX - 图像宽度与原始宽度相乘的数量。)
scaleY
- the amount by which the image height is multiplied relative to the original height.
(scaleY - 图像高度相对于原始高度的乘积。)
public XSSFClientAnchor getPreferredSize(double scaleX, double scaleY)
Picture
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()
Picture
getImageDimension
in interface
Picture
(接口图片中的getImageDimension)
public XSSFClientAnchor getClientAnchor()
getClientAnchor
in interface
Picture
(接口图片中的getClientAnchor)
public XSSFDrawing getDrawing()
public XSSFSheet getSheet()
public java.lang.String getShapeName()
getShapeName
in interface
Shape
(接口 Shape 中的 getShapeName)
public Shape getParent()
public boolean isNoFill()
Shape
public void setNoFill(boolean noFill)
Shape
public void setFillColor(int red, int green, int blue)
Shape
setFillColor
in interface
Shape
(界面Shape中的setFillColor)
public void setLineStyleColor(int red, int green, int blue)
Shape
setLineStyleColor
in interface
Shape
(界面Shape中的setLineStyleColor)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.