Class Thumbnail
Class to manipulate data in the Clipboard Variant (VT_CF) format.
- Since:
- 2002-04-29
- Version:
- $Id: Thumbnail.java 489730 2006-12-22 19:18:16Z bayard $
- Author:
- Drew Varner (Drew.Varner inOrAround sc.edu)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intClipboard Format - Bitmapstatic intClipboard Format - Device Independent Bitmapstatic intClipboard Format - Enhanced Windows metafile formatstatic intClipboard Format - Windows metafile format.static intClipboard Format Tag - Format IDstatic intClipboard Format Tag - Macintosh clipboard formatstatic intClipboard Format Tag - No Datastatic intClipboard Format Tag - Windows clipboard formatstatic intOffset in bytes where the Clipboard Format starts in thebyte[]returned bySummaryInformation.getThumbnail()static intOffset in bytes where the Clipboard Format Tag starts in thebyte[]returned bySummaryInformation.getThumbnail()static intOffset in bytes where the Windows Metafile (WMF) image data starts in thebyte[]returned bySummaryInformation.getThumbnail() -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns anintrepresenting the Clipboard FormatlongReturns anintrepresenting the Clipboard Format Tagbyte[]Returns the thumbnail as abyte[]inVT_CFformat.byte[]Returns the Thumbnail as abyte[]of WMF data if the Thumbnail's Clipboard Format Tag isCFTAG_WINDOWSand its Clipboard Format isCF_METAFILEPICTvoidsetThumbnail(byte[] thumbnail) Sets the Thumbnail's underlyingbyte[]inVT_CFformat.
-
Field Details
-
OFFSET_CFTAG
public static int OFFSET_CFTAGOffset in bytes where the Clipboard Format Tag starts in the
byte[]returned bySummaryInformation.getThumbnail() -
OFFSET_CF
public static int OFFSET_CFOffset in bytes where the Clipboard Format starts in the
byte[]returned bySummaryInformation.getThumbnail()This is only valid if the Clipboard Format Tag is
CFTAG_WINDOWS -
OFFSET_WMFDATA
public static int OFFSET_WMFDATAOffset in bytes where the Windows Metafile (WMF) image data starts in the
byte[]returned bySummaryInformation.getThumbnail()There is only WMF data at this point in the
byte[]if the Clipboard Format Tag isCFTAG_WINDOWSand the Clipboard Format isCF_METAFILEPICT.Note: The
byte[]that starts atOFFSET_WMFDATAand ends atgetThumbnail().length - 1forms a complete WMF image. It can be saved to disk with a.wmffile type and read using a WMF-capable image viewer. -
CFTAG_WINDOWS
public static int CFTAG_WINDOWSClipboard Format Tag - Windows clipboard format
A
DWORDindicating a built-in Windows clipboard format value -
CFTAG_MACINTOSH
public static int CFTAG_MACINTOSHClipboard Format Tag - Macintosh clipboard format
A
DWORDindicating a Macintosh clipboard format value -
CFTAG_FMTID
public static int CFTAG_FMTIDClipboard Format Tag - Format ID
A GUID containing a format identifier (FMTID). This is rarely used.
-
CFTAG_NODATA
public static int CFTAG_NODATAClipboard Format Tag - No Data
A
DWORDindicating No data. This is rarely used. -
CF_METAFILEPICT
public static int CF_METAFILEPICTClipboard 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.
-
CF_DIB
public static int CF_DIBClipboard Format - Device Independent Bitmap
-
CF_ENHMETAFILE
public static int CF_ENHMETAFILEClipboard Format - Enhanced Windows metafile format
-
CF_BITMAP
public static int CF_BITMAPClipboard Format - Bitmap
Obsolete, see <a href="msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp target="_blank">msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp.
-
-
Constructor Details
-
Thumbnail
public Thumbnail()Default Constructor. If you use it then one you'll have to add the thumbnail
byte[]fromSummaryInformation.getThumbnail()to do any useful manipulations, otherwise you'll get aNullPointerException. -
Thumbnail
public Thumbnail(byte[] thumbnailData) Creates a
Thumbnailinstance and initializes with the specified image bytes.- Parameters:
thumbnailData- The thumbnail data
-
-
Method Details
-
getThumbnail
public byte[] getThumbnail()Returns the thumbnail as a
byte[]inVT_CFformat.- Returns:
- The thumbnail value
- See Also:
-
setThumbnail
public void setThumbnail(byte[] thumbnail) Sets the Thumbnail's underlying
byte[]inVT_CFformat.- Parameters:
thumbnail- The new thumbnail value- See Also:
-
getClipboardFormatTag
public long getClipboardFormatTag()Returns an
intrepresenting the Clipboard Format TagPossible return values are:
- Returns:
- A flag indicating the Clipboard Format Tag
-
getClipboardFormat
Returns an
intrepresenting the Clipboard FormatWill throw an exception if the Thumbnail's Clipboard Format Tag is not
CFTAG_WINDOWS.Possible return values are:
- Returns:
- a flag indicating the Clipboard Format
- Throws:
HPSFException- if the Thumbnail isn't CFTAG_WINDOWS
-
getThumbnailAsWMF
Returns the Thumbnail as a
byte[]of WMF data if the Thumbnail's Clipboard Format Tag isCFTAG_WINDOWSand its Clipboard Format isCF_METAFILEPICTThis
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.
- Returns:
- A WMF image of the Thumbnail
- Throws:
HPSFException- if the Thumbnail isn't CFTAG_WINDOWS and CF_METAFILEPICT
-