|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.poi.hpsf.Thumbnail
Class to manipulate data in the Clipboard Variant
(VT_CF
) format.
SummaryInformation.getThumbnail()
Field Summary | |
static int |
CF_BITMAP
Clipboard Format - Bitmap |
static int |
CF_DIB
Clipboard Format - Device Independent Bitmap |
static int |
CF_ENHMETAFILE
Clipboard Format - Enhanced Windows metafile format |
static int |
CF_METAFILEPICT
Clipboard Format - Windows metafile format. |
static int |
CFTAG_FMTID
Clipboard Format Tag - Format ID |
static int |
CFTAG_MACINTOSH
Clipboard Format Tag - Macintosh clipboard format |
static int |
CFTAG_NODATA
Clipboard Format Tag - No Data |
static int |
CFTAG_WINDOWS
Clipboard Format Tag - Windows clipboard format |
static int |
OFFSET_CF
Offset in bytes where the Clipboard Format starts in the byte[] returned by
SummaryInformation.getThumbnail() |
static int |
OFFSET_CFTAG
Offset in bytes where the Clipboard Format Tag starts in the byte[] returned by
SummaryInformation.getThumbnail() |
static int |
OFFSET_WMFDATA
Offset in bytes where the Windows Metafile (WMF) image data starts in the byte[]
returned by SummaryInformation.getThumbnail() |
Constructor Summary | |
Thumbnail()
Default Constructor. |
|
Thumbnail(byte[] thumbnailData)
|
Method Summary | |
int |
getClipboardFormat()
Returns an int representing the Clipboard
Format |
int |
getClipboardFormatTag()
Returns an int representing the Clipboard
Format Tag |
byte[] |
getThumbnail()
Returns the thumbnail as a byte[] in
VT_CF format. |
byte[] |
getThumbnailAsWMF()
Returns the Thumbnail as a byte[]
of WMF data if the Thumbnail's Clipboard Format Tag
is CFTAG_WINDOWS
and its Clipboard Format is
CF_METAFILEPICT |
void |
setThumbnail(byte[] thumbnail)
Sets the Thumbnail's underlying byte[] in
VT_CF format. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int OFFSET_CFTAG
Offset in bytes where the Clipboard Format Tag
starts in the byte[]
returned by
SummaryInformation.getThumbnail()
public static int OFFSET_CF
Offset in bytes where the Clipboard Format
starts in the byte[]
returned by
SummaryInformation.getThumbnail()
This is only valid if the Clipboard Format Tag
is CFTAG_WINDOWS
public static int OFFSET_WMFDATA
Offset in bytes where the Windows Metafile
(WMF) image data starts in the byte[]
returned by SummaryInformation.getThumbnail()
There is only WMF data at this point in the
byte[]
if the Clipboard Format Tag is
CFTAG_WINDOWS
and the Clipboard Format is
CF_METAFILEPICT
.
Note: The byte[]
that starts at
OFFSET_WMFDATA
and ends at
getThumbnail().length - 1
forms a
complete WMF image. It can be saved to disk with a
.wmf
file type and read using a WMF-capable
image viewer.
public static int CFTAG_WINDOWS
Clipboard Format Tag - Windows clipboard format
A DWORD
indicating a built-in Windows clipboard
format value
See: http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
public static int CFTAG_MACINTOSH
Clipboard Format Tag - Macintosh clipboard format
A DWORD
indicating a Macintosh clipboard format value
See: http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
public static int CFTAG_FMTID
Clipboard Format Tag - Format ID
A GUID containing a format identifier (FMTID). This is rarely used.
See: http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
public static int CFTAG_NODATA
Clipboard Format Tag - No Data
a DWORD
indicating No data. This is rarely used.
See: http://msdn.microsoft.com/library/en-us/dnolegen/html/msdn_propset.asp
public static int CF_METAFILEPICT
Clipboard Format - Windows metafile format. This is the recommended way to store thumbnails in Property Streams.
Note: this is not the same format used in regular WMF images. The clipboard version of this format has an extra clipboard-specific header
public static int CF_DIB
Clipboard Format - Device Independent Bitmap
public static int CF_ENHMETAFILE
Clipboard Format - Enhanced Windows metafile format
public static int CF_BITMAP
Clipboard Format - Bitmap
Obsolete, See: msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp
Constructor Detail |
public Thumbnail()
Default Constructor. If you use then one you'll have to add
the thumbnail byte[]
from SummaryInformation.getThumbnail()
to do any useful
manipulations, otherwise you'll get a
NullPointerException
.
public Thumbnail(byte[] thumbnailData)
Method Detail |
public byte[] getThumbnail()
Returns the thumbnail as a byte[]
in
VT_CF
format.
SummaryInformation.getThumbnail()
public void setThumbnail(byte[] thumbnail)
Sets the Thumbnail's underlying byte[]
in
VT_CF
format.
SummaryInformation.getThumbnail()
public int getClipboardFormatTag()
Returns an int
representing the Clipboard
Format Tag
Possible return values are:
public int getClipboardFormat() throws HPSFException
Returns an int
representing the Clipboard
Format
Will throw an exceptionif the Thumbnail's Clipboard
Format Tag is not
CFTAG_WINDOWS
Possible return values are:
HPSFException
- if the Thumbnail isn't CFTAG_WINDOWSpublic byte[] getThumbnailAsWMF() throws HPSFException
Returns the Thumbnail as a byte[]
of WMF data if the Thumbnail's Clipboard Format Tag
is CFTAG_WINDOWS
and its Clipboard Format is
CF_METAFILEPICT
This byte[]
is in the traditional WMF file,
not the clipboard-specific version with special headers.
See http://www.wvware.com/caolan/ora-wmf.html for more information on the WMF image format.
HPSFException
- if the Thumbnail isn't CFTAG_WINDOWS
and CF_METAFILEPICT
|
jakarta-poi 1.6.0-dev | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |