public class XSSFPictureData extends POIXMLDocumentPart implements PictureData
POIXMLDocumentPart.RelationPart| Modifier and Type | Field and Description |
|---|---|
protected static POIXMLRelation[] |
RELATIONS
Relationships for each known picture type
(每种已知图片类型的关系)
|
| Modifier | Constructor and Description |
|---|---|
protected |
XSSFPictureData()
Create a new XSSFPictureData node
(创建一个新的 XSSFPictureData 节点)
|
protected |
XSSFPictureData(PackagePart part)
Construct XSSFPictureData from a package part
(从包部分构造 XSSFPitureData)
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData()
Gets the picture data as a byte array.
(以字节数组的形式获取图片数据。)
|
java.lang.String |
getMimeType()
Returns the mime type for the image
(返回图像的 MIME 类型)
|
int |
getPictureType()
Return an integer constant that specifies type of this picture
(返回指定此图片类型的整数常量)
|
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 对象直接将实际内容存储在部件中,而不像所有其他对象一样保留副本,因此我们需要以不同方式处理它们。)
|
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, toStringprotected static final POIXMLRelation[] RELATIONS
protected XSSFPictureData()
XSSFWorkbook.addPicture(byte[], int)
protected XSSFPictureData(PackagePart part)
part - the package part holding the drawing data,
(part - 包含绘图数据的包部分,)
public byte[] getData()
Note, that this call might be expensive since all the picture data is copied into a temporary byte array. You can grab the picture data directly from the underlying package part as follows:
InputStream is = getPackagePart().getInputStream();
getData in interface
PictureData
(接口 PictureData 中的 getData)
public java.lang.String suggestFileExtension()
suggestFileExtension in interface
PictureData
(接口 PictureData 中的SuggestFileExtension)
public int getPictureType()
getPictureType in interface
PictureData
(接口 PictureData 中的 getPictureType)
Workbook.PICTURE_TYPE_EMF,
Workbook.PICTURE_TYPE_WMF,
Workbook.PICTURE_TYPE_PICT,
Workbook.PICTURE_TYPE_JPEG,
Workbook.PICTURE_TYPE_PNG,
Workbook.PICTURE_TYPE_DIB
public java.lang.String getMimeType()
PictureData
getMimeType in interface
PictureData
(接口 PictureData 中的 getMimeType)
protected void prepareForCommit()
prepareForCommit in class
POIXMLDocumentPart
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.