共用方式為


DataPackagePropertySetView.Thumbnail 屬性

定義

取得 DataPackageView的縮圖影像。

public:
 property RandomAccessStreamReference ^ Thumbnail { RandomAccessStreamReference ^ get(); };
RandomAccessStreamReference Thumbnail();
public RandomAccessStreamReference Thumbnail { get; }
var randomAccessStreamReference = dataPackagePropertySetView.thumbnail;
Public ReadOnly Property Thumbnail As RandomAccessStreamReference

屬性值

代表縮圖影像的 IRandomAccessStreamReference

範例

此範例示範如何從 DataPackageView取得縮圖影像。

if (shareOperation.data.properties.thumbnail) {
    shareOperation.data.properties.thumbnail.openReadAsync().then(function (thumbnailStream) {
        var thumbnailBlob = MSApp.createBlobFromRandomAccessStream(thumbnailStream.contentType, thumbnailStream);
        var thumbnailUrl = URL.createObjectURL(thumbnailBlob, false);
        // To display the thumbnail, you need an element with id of "thumbnail"
        // in your HTML page.
        document.getElementById("thumbnail").src = thumbnailUrl;
    });
}

備註

建議您隨時取得包含影像的 DataPackageView ,您也會檢查縮圖影像。 這麼做可讓您的應用程式在共用作業完成時,向使用者顯示所共用影像的視覺標記法。

適用於