StorageFile.GetThumbnailAsync StorageFile.GetThumbnailAsync StorageFile.GetThumbnailAsync StorageFile.GetThumbnailAsync StorageFile.GetThumbnailAsync Method

Definition

Overloads

GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode)

Retrieves an adjusted thumbnail image for the file, determined by the purpose of the thumbnail.

GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32)

Retrieves an adjusted thumbnail image for the file, determined by the purpose of the thumbnail and the requested size.

GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions)

Retrieves an adjusted thumbnail image for the file, determined by the purpose of the thumbnail, the requested size, and the specified options.

GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode)

Retrieves an adjusted thumbnail image for the file, determined by the purpose of the thumbnail.

public : IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode)
IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode) const;
public IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode)
Public Function GetThumbnailAsync(mode As ThumbnailMode) As IAsyncOperation(Of StorageItemThumbnail)
Windows.Storage.StorageFile.getThumbnailAsync(mode).done( /* Your success and error handlers */ );

Parameters

mode
ThumbnailMode ThumbnailMode ThumbnailMode

The enum value that describes the purpose of the thumbnail and determines how the thumbnail image is adjusted.

For guidance about choosing the best thumbnail mode, see Guidelines and checklist for thumbnails.

Returns

When this method completes successfully, it returns a StorageItemThumbnail that represents the thumbnail image or null if there is no thumbnail image associated with the file.

See also

GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32)

Retrieves an adjusted thumbnail image for the file, determined by the purpose of the thumbnail and the requested size.

public : IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode, unsigned int requestedSize)
IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode, uint32_t requestedSize) const;
public IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode, UInt32 requestedSize)
Public Function GetThumbnailAsync(mode As ThumbnailMode, requestedSize As UInt32) As IAsyncOperation(Of StorageItemThumbnail)
Windows.Storage.StorageFile.getThumbnailAsync(mode, requestedSize).done( /* Your success and error handlers */ );

Parameters

mode
ThumbnailMode ThumbnailMode ThumbnailMode

The enum value that describes the purpose of the thumbnail and determines how the thumbnail image is adjusted.

For guidance about choosing the best thumbnail mode, see Guidelines and checklist for thumbnails.

requestedSize
UInt32 UInt32 UInt32

The requested size, in pixels, of the longest edge of the thumbnail. Windows uses the requestedSize as a guide and tries to scale the thumbnail image without reducing the quality of the image.

If Windows can't find a thumbnail image that it can scale to meet the requested size, a larger thumbnail might be returned. If no larger thumbnail is available, a thumbnail image that is smaller than the requested size might be returned.

Returns

When this method completes successfully, it returns a StorageItemThumbnail that represents the thumbnail image or null if there is no thumbnail image associated with the file.

See also

GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions)

Retrieves an adjusted thumbnail image for the file, determined by the purpose of the thumbnail, the requested size, and the specified options.

public : IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode, unsigned int requestedSize, ThumbnailOptions options)
IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode, uint32_t requestedSize, ThumbnailOptions options) const;
public IAsyncOperation<StorageItemThumbnail> GetThumbnailAsync(ThumbnailMode mode, UInt32 requestedSize, ThumbnailOptions options)
Public Function GetThumbnailAsync(mode As ThumbnailMode, requestedSize As UInt32, options As ThumbnailOptions) As IAsyncOperation(Of StorageItemThumbnail)
Windows.Storage.StorageFile.getThumbnailAsync(mode, requestedSize, options).done( /* Your success and error handlers */ );

Parameters

mode
ThumbnailMode ThumbnailMode ThumbnailMode

The enum value that describes the purpose of the thumbnail and determines how the thumbnail image is adjusted.

For guidance about choosing the best thumbnail mode, see Guidelines and checklist for thumbnails.

requestedSize
UInt32 UInt32 UInt32

The requested size, in pixels, of the longest edge of the thumbnail. Windows uses the requestedSize as a guide and tries to scale the thumbnail image without reducing the quality of the image.

If Windows can't find a thumbnail image that it can scale to meet the requested size, a larger thumbnail might be returned. If no larger thumbnail is available, a thumbnail image that is smaller than the requested size might be returned.

options
ThumbnailOptions ThumbnailOptions ThumbnailOptions

The enum value that describes the desired behavior to use to retrieve the thumbnail image. The specified behavior might affect the size and/or quality of the image and how quickly the thumbnail image is retrieved.

Returns

When this method completes successfully, it returns a StorageItemThumbnail that represents the thumbnail image or null if there is no thumbnail image associated with the file.

Examples

This example shows you how to capture the thumbnail of a file using the [storageFile.getThumbnailAsync(mode, requestedSize, options) method.

storageFile.getThumbnailAsync(
    Windows.Storage.FileProperties.ThumbnailMode.musicView,
    100,
    Windows.Storage.FileProperties.ThumbnailOptions.useCurrentScale).then(
        function (storageItemThumbnail) {
            // Add code to process thumbnail
        }
    );

You must have a StorageFile object (storageFile in the example) that represents your file in order to use one of the StorageFile.GetThumbnailAsync methods.

See also