|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.poi.POIXMLDocumentPart
org.apache.poi.xssf.usermodel.XSSFPictureData
public class XSSFPictureData
Raw picture data, normally attached to a SpreadsheetML Drawing. As a rule, pictures are stored in the /xl/media/ part of a SpreadsheetML package.
| Field Summary | |
|---|---|
protected static POIXMLRelation[] |
RELATIONS
Relationships for each known picture type |
| Fields inherited from class org.apache.poi.POIXMLDocumentPart |
|---|
DEFAULT_XML_OPTIONS |
| Constructor Summary | |
|---|---|
protected |
XSSFPictureData()
Create a new XSSFPictureData node |
protected |
XSSFPictureData(PackagePart part,
PackageRelationship rel)
Construct XSSFPictureData from a package part |
| Method Summary | |
|---|---|
byte[] |
getData()
Gets the picture data as a byte array. |
java.lang.String |
getMimeType()
Returns the mime type for the image |
int |
getPictureType()
Return an integer constant that specifies type of this picture |
java.lang.String |
suggestFileExtension()
Suggests a file extension for this image. |
| Methods inherited from class org.apache.poi.POIXMLDocumentPart |
|---|
addRelation, commit, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final POIXMLRelation[] RELATIONS
| Constructor Detail |
|---|
protected XSSFPictureData()
XSSFWorkbook.addPicture(byte[], int)
protected XSSFPictureData(PackagePart part,
PackageRelationship rel)
part - the package part holding the drawing data,rel - the package relationship holding this drawing,
the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/image| Method Detail |
|---|
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 PictureDatapublic java.lang.String suggestFileExtension()
suggestFileExtension in interface PictureDatapublic int getPictureType()
Workbook.PICTURE_TYPE_EMF,
Workbook.PICTURE_TYPE_WMF,
Workbook.PICTURE_TYPE_PICT,
Workbook.PICTURE_TYPE_JPEG,
Workbook.PICTURE_TYPE_PNG,
Workbook.PICTURE_TYPE_DIBpublic java.lang.String getMimeType()
PictureData
getMimeType in interface PictureData
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||