Thumbnail docs.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352581 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rainer Klute 2002-05-02 08:00:40 +00:00
parent 13b8a4aee4
commit 03182caef7
4 changed files with 182 additions and 294 deletions

View File

@ -11,6 +11,7 @@
<menu label="HPSF"> <menu label="HPSF">
<menu-item label="Overview" href="index.html"/> <menu-item label="Overview" href="index.html"/>
<menu-item label="How To" href="how-to.html"/> <menu-item label="How To" href="how-to.html"/>
<menu-item label="Thumbnails" href="thumbnails.html"/>
<menu-item label="Internals" href="internals.html"/> <menu-item label="Internals" href="internals.html"/>
<menu-item label="To Do" href="todo.html"/> <menu-item label="To Do" href="todo.html"/>
</menu> </menu>

View File

@ -40,6 +40,11 @@
</li> </li>
</ol> </ol>
<p>Please note that there is separate document on <link
href="thumbnails.html">thumbnails</link>!</p>
<anchor id="sec1" /> <anchor id="sec1" />
<section title="Reading Standard Properties"> <section title="Reading Standard Properties">

View File

@ -1,294 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN//">
<html>
<head>
<title>Structure of the byte[] returned by SummaryInformation's
getThumbnailMethod()</title>
</head>
<body>
<p>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>
<p>
/**
* &lt;p&gt;Returns the stream's thumbnail (or &lt;code&gt;null&lt;/code&gt;)&lt;/p&gt;
*/
public byte[] getThumbnail()
{
return (byte[]) getProperty(PropertyIDMap.PID_THUMBNAIL);
}
</p>
<p>Assumptions:</p>
<ul>
<li><p>A Windows machine saved the info</p>
</li>
<li><p>the info is saved in the recommended METAFILE format (Clipboard metafile)</p>
</li>
</ul>
<p>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)</p>
<address>Drew Varner, Drew.Varner -at- sc.edu</address>
<table border="1">
<tr>
<td>&nbsp;</td>
<td colspan="10">byte[] returned by SummaryInformation.getThumbnail()</td>
</tr>
<tr>
<td>Sample Data</td>
<td>71</td>
<td>20660</td>
<td>-1</td>
<td>3</td>
<td>8</td>
<td>?</td>
<td>?</td>
<td>0</td>
<td>1</td>
<td>9</td>
</tr>
<tr>
<td>Description</td>
<td>
<table>
<tr>
<td>VT_CF</td>
</tr>
<tr>
<td>Variant Type - Clipbard Format</td>
</tr>
<tr>
<td>VT_CF==17</td>
</tr>
<tr>
<td>Pointer to a CLIPDATA structure</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>Clipboard Size</td>
</tr>
<tr>
<td>cbSize is the size of the buffer pointed to by pClipData, plus sizeof(ulClipFmt)</td>
</tr>
<tr>
<td>cbSize</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>cftag</td>
</tr>
<tr>
<td>Clipboard Format Tag</td>
</tr>
<tr>
<td>
<ul>
<li>-1L a built-in Windows&reg; clipboard format value.</li>
<li>-2L Macintosh clipboard format value.</li>
<li>-3L A GUID containing a format identifier (FMTID).</li>
<li>0L No data (rarely used)</li>
</ul>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>Format ID</td>
</tr>
<tr>
<td>If cftag is -1 then this is a DWord descibring the image format</td>
</tr>
<tr>
<td>
<ul>
<li>3&nbsp;CF_METAFILEPICT (Windows Metafile) (recommended)</li>
<li>8&nbsp;CF_DIB (Device Independent Bitmap)</li>
</ul>
</td>
</tr>
<tr>
<td>
Note: These formats are specific to Clipboard, and
Clipboard-specific headers will follow
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>mm</td>
</tr>
<tr>
<td>Mapping Mode</td>
</tr>
<tr>
<td>
<table border=1>
<tr>
<th align=left>Value</th>
<th align=left>Mapping Mode</th>
</tr>
<tr>
<td>1</td>
<td>Text</td>
</tr>
<tr>
<td>2</td>
<td>Low Metric</td>
</tr>
<tr>
<td>3</td>
<td>High Metric</td>
</tr>
<tr>
<td>4</td>
<td>Low English</td>
</tr>
<tr>
<td>5</td>
<td>High English</td>
</tr>
<tr>
<td>6</td>
<td>Twips</td>
</tr>
<tr>
<td>7</td>
<td>Isotropic</td>
</tr>
<tr>
<td>8</td>
<td>Anisotropic</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
Table from GFF Format Summary
<a href="http://www.wvware.com/caolan/ora-wmf.html">
http://www.wvware.com/caolan/ora-wmf.html
</a>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>Width</td>
</tr>
<tr>
<td>Width of the Metafile</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>Height</td>
</tr>
<tr>
<td>Height of the Metafile</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>Handle</td>
</tr>
<tr>
<td>Handle to the Metafile in Memory</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>FileType</td>
</tr>
<tr>
<td>
<ul>
<li>0=memory</li>
<li>1=disk</li>
</ul>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>HeaderSize </td>
</tr>
<tr>
<td>
HeaderSize contains the size of the metafile header in 16-bit WORDs.
This value is always 9.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Width</td>
<td>DWord</td>
<td>Unsigned Long</td>
<td>DWord (Long)</td>
<td>DWord</td>
<td>Word</td>
<td>Word</td>
<td>Word</td>
<td>Word</td>
<td>Word</td>
<td>Word</td>
</tr>
<!-- Start of Row to describe extent of CLIPDATA -->
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="9">CLIPDATA Struct</td>
</tr>
<!-- End of Row to describe extent of CLIPDATA -->
<!-- Start of Row to describe extend of Clipboard16MetaHeader-->
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="4">Clipboard16MetaHeader</td>
<td colspan="2">WindowsMetaHeader</td>
</tr>
<!-- End of Row to describe extend of Clipboard16MetaHeader-->
</table>
<p>Infomation taken from http://msdn.microsoft.com and http://www.wvware.com/caolan/ora-wmf.html</p>
</body>
</html>

View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN"
"../dtd/document-v11.dtd">
<!-- $Id$ -->
<document>
<header>
<title>HPSF THUMBNAIL HOW-TO</title>
<authors>
<person name="Drew Varner" email="Drew.Varner@-deleteThis-sc.edu" />
</authors>
</header>
<body>
<section title="The VT_CF Format">
<p>
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.
</p>
<p>
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.
</p>
<p>The <code>VT_CF</code> structure looks like this:</p>
<table>
<tr>
<th>Element:</th>
<td>Clipboard Size</td>
<td>Clipboard Format Tag</td>
<td>Clipboard Data</td>
</tr>
<tr>
<th>Size:</th>
<td>32 bit unsigned integer (DWord)</td>
<td>32 bit signed integer (DWord)</td>
<td>variable length (byte array)</td>
</tr>
</table>
<p>
The Clipboard Size refers to the size (in bytes) of Clipboard Data
(variable size) plus the Clipboard Format (four bytes).
</p>
<p>Clipboard Format Tag has four possible values:</p>
<table>
<tr>
<th>Value</th>
<th>Identifier</th>
<th>Description</th>
</tr>
<tr>
<td><code>-1L</code></td>
<td><code>CFTAG_WINDOWS</code></td>
<td>a built-in Windows&copy; clipboard format value</td>
</tr>
<tr>
<td><code>-2L</code></td>
<td><code>CFTAG_MACINTOSH</code></td>
<td>a Macintosh clipboard format value</td>
</tr>
<tr>
<td><code>-3L</code></td>
<td><code>CFTAG_FMTID</code></td>
<td>a format identifier (FMTID) This is rarely used.</td>
</tr>
<tr>
<td><code>0L</code></td>
<td><code>CFTAG_NODATA</code></td>
<td>No data This is rarely used.</td>
</tr>
</table>
</section>
<section title="Windows Clipboard Data">
<p>
Windows clipboard data has four image formats for thumbnails:
</p>
<table>
<tr>
<th>Value</th>
<th>Identifier</th>
<th>Description</th>
</tr>
<tr>
<td>3</td>
<td><code>CF_METAFILEPICT</code></td>
<td>Windows metafile format - recommended</td>
</tr>
<tr>
<td>8</td>
<td><code>CF_DIB</code></td>
<td>Device Independent Bitmap</td>
</tr>
<tr>
<td>14</td>
<td><code>CF_ENHMETAFILE</code></td>
<td>Enhanced Windows metafile format</td>
</tr>
<tr>
<td>2</td>
<td><code>CF_BITMAP</code></td>
<td>Bitmap - Obsolete - Use <code>CF_DIB</code> instead</td>
</tr>
</table>
<section title="Windows Metafile Format">
<p>
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.
</p>
<p>
The Clipboard Data byte array looks like this when an image is
stored in Windows' Clipboard WMF format.
</p>
<table>
<tr>
<th>Identifier</th>
<td>CF_METAFILEPICT</td>
<td>mm</td>
<td>width</td>
<td>height</td>
<td>handle</td>
<td>WMF data</td>
</tr>
<tr>
<th>Size</th>
<td>32 bit unsigned int</td>
<td>16 bit unsigned(?) int</td>
<td>16 bit unsigned(?) int</td>
<td>16 bit unsigned(?) int</td>
<td>16 bit unsigned(?) int</td>
<td>byte array - variable length</td>
</tr>
<tr>
<th>Description</th>
<td>Clipboard WMF</td>
<td>Mapping Mode</td>
<td>Image Width</td>
<td>Image Height</td>
<td>handle to the WMF data array in memory, or 0</td>
<td>standard WMF byte stream</td>
</tr>
</table>
</section>
<section title="Device Independent Bitmap">
<p><strong>FIXME:</strong> Document Device Independent Bitmap format</p>
</section>
</section>
<section title="Macintosh Clipboard Data">
<p><strong>FIXME:</strong> Document Macintosh clipboard formats.</p>
</section>
</body>
</document>