@Beta public final class XSLFPictureData extends POIXMLDocumentPart implements PictureData
POIXMLDocumentPart.RelationPart
PictureData.PictureType
Modifier | Constructor and Description |
---|---|
protected |
XSLFPictureData()
Create a new XSLFGraphicData node
(创建一个新的 XSLFGraphicData 节点)
|
|
XSLFPictureData(PackagePart part)
Construct XSLFPictureData from a package part
(从包部件构造 XSLFPictureData)
|
Modifier and Type | Method and Description |
---|---|
protected void |
cacheProperties()
Determine and cache image properties
(确定和缓存图像属性)
|
byte[] |
getChecksum()
Gets the checksum - the checksum can be of various length - mostly it's 8 (XSLF) or 16 (HSLF) bytes long.
(获取校验和 - 校验和可以有各种长度 - 大部分是 8 (XSLF) 或 16 (HSLF) 字节长。)
|
java.lang.String |
getContentType()
Returns content type (mime type) of this picture.
(返回此图片的内容类型(mime 类型)。)
|
byte[] |
getData()
Gets the picture data as a byte array.
(以字节数组的形式获取图片数据。)
|
java.lang.String |
getFileName()
Returns the file name of the image, eg image7.jpg .
(返回图像的文件名,例如 image7.jpg 。)
|
java.awt.Dimension |
getImageDimension()
Return the original image dimensions in points (for formats supported by BufferedImage).
(返回以点为单位的原始图像尺寸(对于 BufferedImage 支持的格式)。)
|
java.awt.Dimension |
getImageDimensionInPixels()
Return the original image dimensions in pixels
(返回以像素为单位的原始图像尺寸)
|
int |
getIndex() |
java.io.InputStream |
getInputStream()
An InputStream to read the picture data directly from the underlying package part
(一个InputStream,直接从底层封装部分读取图片数据)
|
PictureData.PictureType |
getType() |
protected void |
prepareForCommit()
*PictureData objects store the actual content in the part directly without keeping a copy like all others therefore we need to handle them differently.
(*PictureData 对象直接将实际内容存储在部件中,而不像所有其他对象一样保留副本,因此我们需要以不同的方式处理它们。)
|
void |
setData(byte[] data)
Sets the binary picture data
(设置二进制图片数据)
|
void |
setIndex(int index) |
java.lang.String |
suggestFileExtension()
Suggests a file extension for this image.
(建议此图像的文件扩展名。)
|
_invokeOnDocumentRead, addRelation, commit, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
protected XSLFPictureData()
public XSLFPictureData(PackagePart part)
part
- the package part holding the drawing data
(part - 包含绘图数据的包部分)
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
(java.io.IOException)
public byte[] getData()
getInputStream()
method
(以字节数组的形式获取图片数据。可以通过getInputStream()方法直接从底层包部分抓取图片数据)
getData
in interface
PictureData
(接口 PictureData 中的 getData)
public java.lang.String getFileName()
public java.lang.String suggestFileExtension()
public byte[] getChecksum()
PictureData
getChecksum
in interface
PictureData
(接口 PictureData 中的 getChecksum)
public java.awt.Dimension getImageDimension()
PictureData
getImageDimension
in interface
PictureData
(接口 PictureData 中的 getImageDimension)
public java.awt.Dimension getImageDimensionInPixels()
PictureData
getImageDimensionInPixels
in interface
PictureData
(接口 PictureData 中的 getImageDimensionInPixels)
PictureData.getImageDimension()
protected void cacheProperties()
protected void prepareForCommit()
prepareForCommit
in class
POIXMLDocumentPart
public java.lang.String getContentType()
PictureData
getContentType
in interface
PictureData
(接口 PictureData 中的 getContentType)
public void setData(byte[] data) throws java.io.IOException
PictureData
setData
in interface
PictureData
(接口 PictureData 中的 setData)
data
- picture data
(数据 - 图片数据)
java.io.IOException
(java.io.IOException)
public PictureData.PictureType getType()
getType
in interface
PictureData
(接口 PictureData 中的 getType)
public int getIndex()
public void setIndex(int index)
index
- sets the 0-based index of this pictures within the picture parts
(index - 设置图片部分中此图片的从 0 开始的索引)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.