diff --git a/src/documentation/xdocs/hpsf/book.xml b/src/documentation/xdocs/hpsf/book.xml index 2b5cad7d5..529baed75 100644 --- a/src/documentation/xdocs/hpsf/book.xml +++ b/src/documentation/xdocs/hpsf/book.xml @@ -11,6 +11,7 @@
diff --git a/src/documentation/xdocs/hpsf/how-to.xml b/src/documentation/xdocs/hpsf/how-to.xml index 195e8c78f..bdb49d044 100644 --- a/src/documentation/xdocs/hpsf/how-to.xml +++ b/src/documentation/xdocs/hpsf/how-to.xml @@ -40,6 +40,11 @@ +Please note that there is separate document on thumbnails!
+ + +This is a rough HTML file 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 Varner, Drew.Varner -at- sc.edu - -- | byte[] returned by SummaryInformation.getThumbnail() | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sample Data | -71 | -20660 | --1 | -3 | -8 | -? | -? | -0 | -1 | -9 | -||||||||||||||||||||||||||||||||||||||||||||||
Description | - -
-
|
-
-
|
-
-
-
|
-
-
-
|
-
-
-
|
-
-
-
|
-
-
|
-
-
|
-
-
-
|
-
-
-
|
- ||||||||||||||||||||||||||||||||||||||||||||||
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
- - diff --git a/src/documentation/xdocs/hpsf/thumbnails.xml b/src/documentation/xdocs/hpsf/thumbnails.xml new file mode 100644 index 000000000..5e80945d2 --- /dev/null +++ b/src/documentation/xdocs/hpsf/thumbnails.xml @@ -0,0 +1,176 @@ + + + + ++ Thumbnail information is stored as a VT_CF, or Thumbnail Variant. + The Thumbnail Variant is used to store various types of information + in a clipboard. The VT_CF can store information in formats for the + Macintosh or Windows clipboard. +
+ ++ There are many types of data that can be copied to the clipboard, + but the only types of information needed for thumbnail manipulation are + the image formats. +
+ +The VT_CF
structure looks like this:
Element: | +Clipboard Size | +Clipboard Format Tag | +Clipboard Data | +
---|---|---|---|
Size: | +32 bit unsigned integer (DWord) | +32 bit signed integer (DWord) | +variable length (byte array) | +
+ The Clipboard Size refers to the size (in bytes) of Clipboard Data + (variable size) plus the Clipboard Format (four bytes). +
+ +Clipboard Format Tag has four possible values:
+ +Value | +Identifier | +Description | +
---|---|---|
-1L |
+ CFTAG_WINDOWS |
+ a built-in Windows© clipboard format value | +
-2L |
+ CFTAG_MACINTOSH |
+ a Macintosh clipboard format value | +
-3L |
+ CFTAG_FMTID |
+ a format identifier (FMTID) This is rarely used. | +
0L |
+ CFTAG_NODATA |
+ No data This is rarely used. | +
+ Windows clipboard data has four image formats for thumbnails: +
+ +Value | +Identifier | +Description | +
---|---|---|
3 | +CF_METAFILEPICT |
+ Windows metafile format - recommended | +
8 | +CF_DIB |
+ Device Independent Bitmap | +
14 | +CF_ENHMETAFILE |
+ Enhanced Windows metafile format | +
2 | +CF_BITMAP |
+ Bitmap - Obsolete - Use CF_DIB instead |
+
+ The most common format for thumbnails on the Windows platform + is the Windows metafile format. The Clipboard places and extra + header in front of a the standard Windows Metafile Format data. +
+ ++ The Clipboard Data byte array looks like this when an image is + stored in Windows' Clipboard WMF format. +
+ +Identifier | +CF_METAFILEPICT | +mm | +width | +height | +handle | +WMF data | +
---|---|---|---|---|---|---|
Size | +32 bit unsigned int | +16 bit unsigned(?) int | +16 bit unsigned(?) int | +16 bit unsigned(?) int | +16 bit unsigned(?) int | +byte array - variable length | +
Description | +Clipboard WMF | +Mapping Mode | +Image Width | +Image Height | +handle to the WMF data array in memory, or 0 | +standard WMF byte stream | +
FIXME: Document Device Independent Bitmap format
+FIXME: Document Macintosh clipboard formats.
+