org.apache.poi.hwpf.usermodel
public final class Picture extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
BMP |
static byte[] |
COMPRESSED1 |
static byte[] |
COMPRESSED2 |
static byte[] |
EMF |
static byte[] |
GIF |
static byte[] |
IHDR |
static byte[] |
JPG |
static byte[] |
PNG |
static byte[] |
TIFF |
static byte[] |
TIFF1 |
static byte[] |
WMF1 |
static byte[] |
WMF2 |
Constructor and Description |
---|
Picture(byte[] _dataStream) |
Picture(int dataBlockStartOfsset,
byte[] _dataStream,
boolean fillBytes) |
Modifier and Type | Method and Description |
---|---|
int |
getAspectRatioX()
returns horizontal aspect ratio for picture provided by user
|
int |
getAspectRatioY()
returns vertical aspect ratio for picture provided by user
|
byte[] |
getContent() |
int |
getHeight()
returns pixel height of the picture or -1 if dimensions determining was failed
|
byte[] |
getRawContent() |
int |
getSize() |
int |
getWidth()
returns pixel width of the picture or -1 if dimensions determining was failed
|
java.lang.String |
suggestFileExtension()
tries to suggest extension for picture's file by matching signatures of popular image formats to first bytes
of picture's contents
|
java.lang.String |
suggestFullFileName()
Tries to suggest a filename: hex representation of picture structure offset in "Data" stream plus extension that
is tried to determine from first byte of picture's content.
|
void |
writeImageContent(java.io.OutputStream out)
Writes Picture's content bytes to specified OutputStream.
|
public static final byte[] GIF
public static final byte[] PNG
public static final byte[] JPG
public static final byte[] BMP
public static final byte[] TIFF
public static final byte[] TIFF1
public static final byte[] EMF
public static final byte[] WMF1
public static final byte[] WMF2
public static final byte[] IHDR
public static final byte[] COMPRESSED1
public static final byte[] COMPRESSED2
public Picture(int dataBlockStartOfsset, byte[] _dataStream, boolean fillBytes)
public Picture(byte[] _dataStream)
public java.lang.String suggestFullFileName()
public void writeImageContent(java.io.OutputStream out) throws java.io.IOException
out
- a stream to write tojava.io.IOException
- if some exception is occured while writing to specified outpublic byte[] getContent()
public byte[] getRawContent()
public int getSize()
public int getAspectRatioX()
public int getAspectRatioY()
public java.lang.String suggestFileExtension()
public int getWidth()
public int getHeight()
Copyright 2016 The Apache Software Foundation or its licensors, as applicable.