public final class Thumbnail
extends java.lang.Object
Class to manipulate data in the Clipboard Variant (VT_CF
) format.
Modifier and Type | Field and Description |
---|---|
static int |
CF_BITMAP
Clipboard Format - Bitmap
(剪贴板格式 - 位图)
|
static int |
CF_DIB
Clipboard Format - Device Independent Bitmap
(剪贴板格式 - 设备无关位图)
|
static int |
CF_ENHMETAFILE
Clipboard Format - Enhanced Windows metafile format
(剪贴板格式 - 增强的 Windows 图元文件格式)
|
static int |
CF_METAFILEPICT
Clipboard Format - Windows metafile format.
(剪贴板格式 - Windows 图元文件格式。)
|
static int |
CFTAG_FMTID
Clipboard Format Tag - Format ID
(剪贴板格式标记 - 格式 ID)
|
static int |
CFTAG_MACINTOSH
Clipboard Format Tag - Macintosh clipboard format
(剪贴板格式标签 - Macintosh 剪贴板格式)
|
static int |
CFTAG_NODATA
Clipboard Format Tag - No Data
(剪贴板格式标签 - 无数据)
|
static int |
CFTAG_WINDOWS
Clipboard Format Tag - Windows clipboard format
(剪贴板格式标记 - Windows 剪贴板格式)
|
static int |
OFFSET_CF
Offset in bytes where the Clipboard Format starts in the
byte[] returned by
SummaryInformation.getThumbnail()
(剪贴板格式在 SummaryInformation.getThumbnail() 返回的 byte[] 中开始的偏移量(以字节为单位))
|
static int |
OFFSET_CFTAG
Offset in bytes where the Clipboard Format Tag starts in the
byte[] returned by
SummaryInformation.getThumbnail()
(剪贴板格式标记在 SummaryInformation.getThumbnail() 返回的 byte[] 中开始的偏移量(以字节为单位))
|
static int |
OFFSET_WMFDATA
Offset in bytes where the Windows Metafile (WMF) image data starts in the
byte[] returned by
SummaryInformation.getThumbnail()
(Windows 图元文件 (WMF) 图像数据在 SummaryInformation.getThumbnail() 返回的 byte[] 中开始的偏移量(以字节为单位))
|
Constructor and Description |
---|
Thumbnail()
Default Constructor.
|
Thumbnail(byte[] thumbnailData)
Creates a
Thumbnail instance and initializes with the specified image bytes.
|
Modifier and Type | Method and Description |
---|---|
long |
getClipboardFormat()
Returns an
int representing the Clipboard Format
(返回一个表示剪贴板格式的 int)
|
long |
getClipboardFormatTag()
Returns an
int representing the Clipboard Format Tag
(返回一个表示剪贴板格式标签的 int)
|
byte[] |
getThumbnail()
|
byte[] |
getThumbnailAsWMF()
Returns the Thumbnail as a
byte[] of WMF data if the Thumbnail's Clipboard Format Tag is
CFTAG_WINDOWS and its Clipboard Format is
CF_METAFILEPICT
(如果缩略图的剪贴板格式标记为 CFTAG_WINDOWS 并且其剪贴板格式为 CF_METAFILEPICT,则将缩略图作为 WMF 数据的字节 [] 返回)
|
void |
setThumbnail(byte[] thumbnail)
|
public static final int OFFSET_CFTAG
Offset in bytes where the Clipboard Format Tag starts in the byte[]
returned by SummaryInformation.getThumbnail()
public static final int OFFSET_CF
Offset in bytes where the Clipboard Format starts in the byte[]
returned by SummaryInformation.getThumbnail()
This is only valid if the Clipboard Format Tag is CFTAG_WINDOWS
public static final int OFFSET_WMFDATA
Offset in bytes where the Windows Metafile (WMF) image data starts in the byte[]
returned by SummaryInformation.getThumbnail()
There is only WMF data at this point in the byte[]
if the Clipboard Format Tag is CFTAG_WINDOWS
and the Clipboard Format is CF_METAFILEPICT
.
Note: The byte[]
that starts at OFFSET_WMFDATA
and ends at getThumbnail().length - 1
forms a complete WMF image. It can be saved to disk with a .wmf
file type and read using a WMF-capable image viewer.
public static final int CFTAG_WINDOWS
Clipboard Format Tag - Windows clipboard format
A DWORD
indicating a built-in Windows clipboard format value
public static final int CFTAG_MACINTOSH
Clipboard Format Tag - Macintosh clipboard format
A DWORD
indicating a Macintosh clipboard format value
public static final int CFTAG_FMTID
Clipboard Format Tag - Format ID
A GUID containing a format identifier (FMTID). This is rarely used.
(剪贴板格式标记 - 格式 ID 包含格式标识符 (FMTID) 的 GUID。这很少使用。)public static final int CFTAG_NODATA
Clipboard Format Tag - No Data
A DWORD
indicating No data. This is rarely used.
public static final int CF_METAFILEPICT
Clipboard 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.
(剪贴板格式 - Windows 图元文件格式。这是在 Property Streams 中存储缩略图的推荐方式。注意:这与常规 WMF 图像中使用的格式不同。这种格式的剪贴板版本有一个额外的特定于剪贴板的标题。)public static final int CF_DIB
Clipboard Format - Device Independent Bitmap
(剪贴板格式 - 设备无关位图)public static final int CF_ENHMETAFILE
Clipboard Format - Enhanced Windows metafile format
(剪贴板格式 - 增强的 Windows 图元文件格式)public static final int CF_BITMAP
Clipboard Format - Bitmap
(剪贴板格式 - 位图)public Thumbnail()
Default Constructor. If you use it then one you'll have to add the thumbnail byte[]
from SummaryInformation.getThumbnail()
to do any useful manipulations, otherwise you'll get a NullPointerException
.
public Thumbnail(byte[] thumbnailData)
Creates a Thumbnail
instance and initializes with the specified image bytes.
thumbnailData
- The thumbnail data
(thumbnailData - 缩略图数据)
public byte[] getThumbnail()
Returns the thumbnail as a byte[]
in VT_CF
format.
SummaryInformation.getThumbnail()
public void setThumbnail(byte[] thumbnail)
Sets the Thumbnail's underlying byte[]
in VT_CF
format.
thumbnail
- The new thumbnail value
(thumbnail - 新的缩略图值)
SummaryInformation.getThumbnail()
public long getClipboardFormatTag()
Returns an int
representing the Clipboard Format Tag
Possible return values are:
(返回一个表示剪贴板格式标签的 int 可能的返回值是: CFTAG_WINDOWS CFTAG_MACINTOSH CFTAG_FMTID CFTAG_NODATA)public long getClipboardFormat() throws HPSFException
Returns an int
representing the Clipboard Format
Will throw an exception if the Thumbnail's Clipboard Format Tag is not CFTAG_WINDOWS
.
Possible return values are:
(返回一个表示剪贴板格式的 int 如果缩略图的剪贴板格式标记不是 CFTAG_WINDOWS,将引发异常。可能的返回值为: CF_METAFILEPICT CF_DIB CF_ENHMETAFILE CF_BITMAP)HPSFException
- if the Thumbnail isn't CFTAG_WINDOWS
(HPSFException - 如果缩略图不是 CFTAG_WINDOWS)
public byte[] getThumbnailAsWMF() throws HPSFException
Returns the Thumbnail as a byte[]
of WMF data if the Thumbnail's Clipboard Format Tag is CFTAG_WINDOWS
and its Clipboard Format is CF_METAFILEPICT
This 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.
(如果缩略图的剪贴板格式标记为 CFTAG_WINDOWS 且其剪贴板格式为 CF_METAFILEPICT,则将缩略图作为 WMF 数据的字节 [] 返回。此字节 [] 位于传统的 WMF 文件中,而不是具有特殊标题的剪贴板特定版本。有关 WMF 图像格式的更多信息,请参见 http://www.wvware.com/caolan/ora-wmf.html。)HPSFException
- if the Thumbnail isn't CFTAG_WINDOWS and CF_METAFILEPICT
(HPSFException - 如果缩略图不是 CFTAG_WINDOWS 和 CF_METAFILEPICT)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.