HPSF THUMBNAIL HOW-TO(HPSF 缩略图操作方法)
The VT_CF Format(VT_CF 格式)
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.(缩略图信息存储为 VT_CF 或缩略图变体。 Thumbnail Variant 用于在剪贴板中存储各种类型的信息。 VT_CF 可以以 Macintosh 或 Windows 剪贴板格式存储信息。)
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:(VT_CF 结构如下所示:)
Element:(元素:) | Clipboard Size(剪贴板大小) | Clipboard Format Tag(剪贴板格式标签) | Clipboard Data(剪贴板数据) |
---|---|---|---|
Size:(尺寸:) | 32 bit unsigned integer (DWord)(32 位无符号整数 (DWord)) | 32 bit signed integer (DWord)(32 位有符号整数 (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(-1L) | CFTAG_WINDOWS(CFTAG_WINDOWS) | a built-in Windows© clipboard format value(内置的 Windows© 剪贴板格式值) |
-2L(-2L) | CFTAG_MACINTOSH(CFTAG_MACINTOSH) | a Macintosh clipboard format value(Macintosh 剪贴板格式值) |
-3L(-3L) | CFTAG_FMTID(CFTAG_FMTID) | a format identifier (FMTID) This is rarely used.(格式标识符 (FMTID) 这很少使用。) |
0L(0L) | CFTAG_NODATA(CFTAG_NODATA) | No data This is rarely used.(无数据 这很少使用。) |
Windows Clipboard Data(Windows 剪贴板数据)
Windows clipboard data has four image formats for thumbnails:(Windows 剪贴板数据有四种缩略图图像格式:)
Value(价值) | Identifier(确认) | Description(描述) |
---|---|---|
3(3) | CF_METAFILEPICT(CF_METAFILEPICT) | Windows metafile format - recommended(Windows 元文件格式 - 推荐) |
8(8) | CF_DIB(CF_DIB) | Device Independent Bitmap(设备无关位图) |
14(14) | CF_ENHMETAFILE(CF_ENHMETAFILE) | Enhanced Windows metafile format(增强的 Windows 元文件格式) |
2(2) | CF_BITMAP(CF_BITMAP) | Bitmap - Obsolete - Use CF_DIB instead(位图 - 已过时 - 改用 CF_DIB) |
Windows Metafile Format(Windows 元文件格式)
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.(Windows 平台上最常见的缩略图格式是 Windows 元文件格式。剪贴板在标准 Windows 元文件格式数据的前面放置和额外的标题。)
The Clipboard Data byte array looks like this when an image is stored in Windows' Clipboard WMF format.(当图像以 Windows 的剪贴板 WMF 格式存储时,剪贴板数据字节数组如下所示。)
Identifier(确认) | CF_METAFILEPICT(CF_METAFILEPICT) | mm(毫米) | width(宽度) | height(高度) | handle(处理) | WMF data(WMF 数据) |
---|---|---|---|---|---|---|
Size(尺寸) | 32 bit unsigned int(32 位无符号整数) | 16 bit unsigned(?) int(16 位无符号(?)整数) | 16 bit unsigned(?) int(16 位无符号(?)整数) | 16 bit unsigned(?) int(16 位无符号(?)整数) | 16 bit unsigned(?) int(16 位无符号(?)整数) | byte array - variable length(字节数组 - 可变长度) |
Description(描述) | Clipboard WMF(剪贴板 WMF) | Mapping Mode(映射模式) | Image Width(图像宽度) | Image Height(图像高度) | handle to the WMF data array in memory, or 0(内存中 WMF 数据数组的句柄,或 0) | standard WMF byte stream(标准 WMF 字节流) |
Device Independent Bitmap(设备无关位图)
FIXME: Describe the Device Independent Bitmap format!(FIXME:描述与设备无关的位图格式!)
Macintosh Clipboard Data(Macintosh 剪贴板数据)
FIXME: Describe the Macintosh clipboard formats!(FIXME:描述 Macintosh 剪贴板格式!)
by Drew Varner(德鲁·瓦纳)