public class XSSFPictureData extends POIXMLDocumentPart implements PictureData
Modifier and Type | Field and Description |
---|---|
protected static POIXMLRelation[] |
RELATIONS
Relationships for each known picture type
|
DEFAULT_XML_OPTIONS
Modifier | Constructor and Description |
---|---|
protected |
XSSFPictureData()
Create a new XSSFPictureData node
|
protected |
XSSFPictureData(PackagePart part,
PackageRelationship rel)
Construct XSSFPictureData from a package part
|
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
|
int |
getPictureType()
Return an integer constant that specifies type of this picture
|
int |
getRelationCounter() |
java.lang.String |
suggestFileExtension()
Suggests a file extension for this image.
|
addRelation, clearMemoryPackagePart, commit, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toString
protected static final POIXMLRelation[] RELATIONS
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/imagepublic 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
public java.lang.String suggestFileExtension()
suggestFileExtension
in interface PictureData
public 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_DIB
public java.lang.String getMimeType()
PictureData
getMimeType
in interface PictureData
public int getRelationCounter()
getRelationCounter
in interface PictureData
getRelationCounter
in class POIXMLDocumentPart
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.