Package org.apache.poi.hslf.blip
Class EMF
java.lang.Object
org.apache.poi.hslf.usermodel.HSLFPictureData
org.apache.poi.hslf.blip.Metafile
org.apache.poi.hslf.blip.EMF
- All Implemented Interfaces:
GenericRecord,PictureData
Represents EMF (Windows Enhanced Metafile) picture data.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.hslf.blip.Metafile
Metafile.HeaderNested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.PictureData
PictureData.PictureType -
Field Summary
Fields inherited from class org.apache.poi.hslf.usermodel.HSLFPictureData
CHECKSUM_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionEMF(EscherContainerRecord recordContainer, EscherBSERecord bse) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]formatImageForSlideshow(byte[] data) Formats the picture data for storage in the slideshow.byte[]getData()Returns the binary data of this PictureintEMF signature is0x3D40or0x3D50getType()voidsetSignature(int signature) Sets the EMF signature - either0x3D40or0x3D50Methods inherited from class org.apache.poi.hslf.blip.Metafile
compress, getImageDimension, getMaxRecordLength, setMaxRecordLengthMethods inherited from class org.apache.poi.hslf.usermodel.HSLFPictureData
getChecksum, getChecksum, getContentType, getGenericProperties, getHeader, getImageDimensionInPixels, getIndex, getOffset, getRawData, getUID, getUIDInstanceCount, setData, setIndex, setUIDInstanceCount, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
Constructor Details
-
EMF
Creates a new instance.- Parameters:
recordContainer- Record tracking all pictures. Should be attached to the slideshow that this picture is linked to.bse- Record referencing this picture. Should be attached to the slideshow that this picture is linked to.
-
-
Method Details
-
getData
public byte[] getData()Returns the binary data of this Picture- Returns:
- picture data
- Throws:
RecordFormatException- if there is a problem with the size of the decompressed data.Metafile.setMaxRecordLength(int)can be used to change the limit applied.HSLFException- for parsing exceptions
-
formatImageForSlideshow
protected byte[] formatImageForSlideshow(byte[] data) Description copied from class:HSLFPictureDataFormats the picture data for storage in the slideshow.Images stored in
HSLFSlideShows are represented differently than when they are standalone files. The exact formatting differs for each image type.- Specified by:
formatImageForSlideshowin classHSLFPictureData- Parameters:
data- Original image data. If these bytes were written to a disk, a common image viewer would be able to render the image.- Returns:
- Formatted image representation.
-
getType
- Returns:
- the picture type
-
getSignature
public int getSignature()EMF signature is0x3D40or0x3D50- Specified by:
getSignaturein classHSLFPictureData- Returns:
- EMF signature (
0x3D40or0x3D50)
-
setSignature
public void setSignature(int signature) Sets the EMF signature - either0x3D40or0x3D50- Specified by:
setSignaturein classHSLFPictureData
-