Delen via


DataPackagePropertySetView.Thumbnail Property

Definition

Gets the thumbnail image for the DataPackageView.

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

Property Value

The IRandomAccessStreamReference that represents the thumbnail image.

Examples

This example shows how you can get a thumbnail image from a 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;
    });
}

Remarks

We recommend that any time you get a DataPackageView that contains an image, you also check for thumbnail image. Doing so gives allows your app to display a visual representation of the images being shared to the user while the share operation completes.

Applies to