|
||||||||||
| 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.xslf.usermodel.XSLFPictureData
@Beta public final class XSLFPictureData
Instantiates sub-classes of POIXMLDocumentPart depending on their relationship type
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.poi.POIXMLDocumentPart |
|---|
POIXMLDocumentPart.RelationPart |
| Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.PictureData |
|---|
PictureData.PictureType |
| Constructor Summary | |
|---|---|
protected |
XSLFPictureData()
Create a new XSLFGraphicData node |
|
XSLFPictureData(PackagePart part)
Construct XSLFPictureData from a package part |
| Method Summary | |
|---|---|
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. |
java.lang.String |
getContentType()
Returns content type (mime type) of this picture. |
byte[] |
getData()
Gets the picture data as a byte array. |
java.lang.String |
getFileName()
Returns the file name of the image, eg image7.jpg . |
java.awt.Dimension |
getImageDimension()
Return the original image dimensions in points (for formats supported by 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 |
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. |
void |
setData(byte[] data)
Sets the binary picture data |
void |
setIndex(int index)
|
java.lang.String |
suggestFileExtension()
Suggests a file extension for this image. |
| Methods inherited from class org.apache.poi.POIXMLDocumentPart |
|---|
_invokeOnDocumentRead, addRelation, commit, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationParts, 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 |
| Constructor Detail |
|---|
protected XSLFPictureData()
public XSLFPictureData(PackagePart part)
part - the package part holding the drawing data| Method Detail |
|---|
public java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionpublic byte[] getData()
getInputStream() method
getData in interface PictureDatapublic java.lang.String getFileName()
public java.lang.String suggestFileExtension()
public byte[] getChecksum()
PictureData
getChecksum in interface PictureDatapublic java.awt.Dimension getImageDimension()
PictureData
getImageDimension in interface PictureDatapublic java.awt.Dimension getImageDimensionInPixels()
PictureData
getImageDimensionInPixels in interface PictureDataPictureData.getImageDimension()protected void cacheProperties()
protected void prepareForCommit()
prepareForCommit in class POIXMLDocumentPartpublic java.lang.String getContentType()
PictureData
getContentType in interface PictureData
public void setData(byte[] data)
throws java.io.IOException
PictureData
setData in interface PictureDatadata - picture data
java.io.IOExceptionpublic PictureData.PictureType getType()
getType in interface PictureDatapublic int getIndex()
public void setIndex(int index)
index - sets the 0-based index of this pictures within the picture parts
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||