IXpsFixedPageWriter.AddThumbnail(XpsImageType) Method

Definition

將指定之 XpsImageType 的縮圖影像加入至目前頁面。Adds a thumbnail image of a specified XpsImageType to the current page.

public:
 System::Windows::Xps::Packaging::XpsThumbnail ^ AddThumbnail(System::Windows::Xps::Packaging::XpsImageType imageType);
public System.Windows.Xps.Packaging.XpsThumbnail AddThumbnail (System.Windows.Xps.Packaging.XpsImageType imageType);
abstract member AddThumbnail : System.Windows.Xps.Packaging.XpsImageType -> System.Windows.Xps.Packaging.XpsThumbnail
Public Function AddThumbnail (imageType As XpsImageType) As XpsThumbnail

Parameters

imageType
XpsImageType

要加入至頁面之縮圖影像的影像類型。The image type of the thumbnail image to add to the page.

Returns

XpsThumbnail

已加入的新縮圖影像資源。The new thumbnail image resource that was added.

Exceptions

已經呼叫 AddThumbnail(XpsImageType) 以加入這個頁面的影像縮圖。AddThumbnail(XpsImageType) has already been called to add an image thumbnail for this page.

Dispose() 已被呼叫。Dispose() has been called.

Remarks

AddThumbnail 會將新的 XpsImageType 加入檔封裝,並將其與目前的 FixedPage產生關聯。AddThumbnail adds a new XpsImageType to the document package and associates it with the current FixedPage.

例如,imageType 可以是 JpegImageTypePngImageTypeFor example, imageType can be JpegImageType or PngImageType. 分別新增 JPEG 或 PNG 縮圖影像。to add a JPEG or PNG thumbnail image, respectively.

Notes to Implementers

每個頁面只能包含一個縮圖。Each page can only contain with one thumbnail. 如果呼叫 AddThumbnail(XpsImageType) 來為頁面新增一個以上的縮圖影像,則會擲回 InvalidOperationExceptionAn InvalidOperationException is thrown if AddThumbnail(XpsImageType) is called to add more than one thumbnail image for the page.

Applies to