Attached is a rough HTML file I wrote that describes the structure of the byte
[] returned by SummaryInformation's getThumbnailMethod() when it is implemented 
like this (simply remove the Exception it currently throws):

    /**
     * <p>Returns the stream's thumbnail (or <code>null</code>)</p>
     */
    public byte[] getThumbnail()
    {
        return (byte[]) getProperty(PropertyIDMap.PID_THUMBNAIL);
    }

Assumptions:
   + A Windows machine saved the info
   + the info is saved in the recommended METAFILE format (Clipboard metafile)

The standard WMF file byte array begins at position 24 of the array (beginning 
of WindowsMetaHeader struct) and ends with the end of the array.
The first 24 bytes are Cliboard specific headers. (VT_CF - Variant Type 
Clipboard Format)

- Drew
___________________
Drew Varner
[EMAIL PROTECTED]
 
  byte[] returned by SummaryInformation.getThumbnail()
Sample Data 71 20660 -1 3 8 ? ? 0 1 9
Description
VT_CF
Variant Type - Clipbard Format
VT_CF==17
Pointer to a CLIPDATA structure
Clipboard Size
cbSize is the size of the buffer pointed to by pClipData, plus sizeof(ulClipFmt)
cbSize
cftag
Clipboard Format Tag
  • -1L a built-in Windows® clipboard format value.
  • -2L Macintosh clipboard format value.
  • -3L A GUID containing a format identifier (FMTID).
  • 0L No data (rarely used)
Format ID
If cftag is -1 then this is a DWord descibring the image format
  • 3 CF_METAFILEPICT (Windows Metafile) (recommended)
  • 8 CF_DIB (Device Independent Bitmap)
Note: These formats are specific to Clipboard, and Clipboard-specific headers will follow
mm
Mapping Mode
Value Mapping Mode
1 Text
2 Low Metric
3 High Metric
4 Low English
5 High English
6 Twips
7 Isotropic
8 Anisotropic
Table from GFF Format Summary http://www.wvware.com/caolan/ora-wmf.html
Width
Width of the Metafile
Height
Height of the Metafile
Handle
Handle to the Metafile in Memory
FileType
  • 0=memory
  • 1=disk
HeaderSize
HeaderSize contains the size of the metafile header in 16-bit WORDs. This value is always 9.
Width DWord Unsigned Long DWord (Long) DWord Word Word Word Word Word Word
    CLIPDATA Struct
          Clipboard16MetaHeader WindowsMetaHeader

Infomation taken from http://msdn.microsoft.com and http://www.wvware.com/caolan/ora-wmf.html

Reply via email to