DeviceThumbnail DeviceThumbnail DeviceThumbnail DeviceThumbnail Class

Represents the thumbnail image for a device.

Syntax

Declaration

public sealed class DeviceThumbnailpublic sealed class DeviceThumbnailPublic NotInheritable Class DeviceThumbnail

Remarks

Call GetThumbnailAsync() and handle the completion event as shown in the example.

Examples

// Takes a parameter of type DeviceInformation
// and retrieves a DeviceThumbnail to pass to displayImage().
function getImage (device) {   

    var thumbnail = null;
    if (device){
        device.getThumbnailAsync().then(
            function (thumbnail) {
                if (thumbnail){      
                    if (thumbnail.size > 0) {
                        displayImage(thumbnail);
                    }                                                                      
                 }     
             });
    }                                                                                     
}

function displayImage(imageFile) {

    try {
        // Setting 2nd parameter to 'false' cleans up 
        // the URL after first use.
        // We set this because we only need to load the URL
        // into the image tag once.
        document.getElementById("deviceImage").src = 
            window.URL.createObjectURL(imageFile, false);
    } catch (e) {
        document.getElementById("statusMessage").innerHTML = 
            "Could not display image, error: " + e.message;
    }

}

Properties summary

Gets a value that indicates whether the stream can be read from.

Gets a value that indicates whether the stream can be written to.

Returns the content type of the thumbnail image.

Gets the byte offset of the stream.

Gets or sets the size of the device thumbnail image.

Methods summary

Creates a new instance of a IRandomAccessStream over the same resource as the current stream.

Closes the current stream and releases system resources.

Flushes data asynchronously in a sequential stream.

Returns a pointer to an input stream starting at the specified location.

Returns a pointer to an output stream starting at the specified location.

Returns an asynchronous byte reader object.

Sets the position of the stream to the specified value.

Writes data asynchronously in a sequential stream.

Properties

  • CanRead
    CanRead
    CanRead
    CanRead

    Gets a value that indicates whether the stream can be read from.

    public bool CanRead { get; }public bool CanRead { get; }Public ReadOnly Property CanRead As bool

    Property Value

    • bool
      bool
      bool
      bool

      True if the stream can be read from. Otherwise, false.

  • CanWrite
    CanWrite
    CanWrite
    CanWrite

    Gets a value that indicates whether the stream can be written to.

    public bool CanWrite { get; }public bool CanWrite { get; }Public ReadOnly Property CanWrite As bool

    Property Value

    • bool
      bool
      bool
      bool

      True if the stream can be written to. Otherwise, false.

  • ContentType
    ContentType
    ContentType
    ContentType

    Returns the content type of the thumbnail image.

    public string ContentType { get; }public string ContentType { get; }Public ReadOnly Property ContentType As string

    Property Value

    • string
      string
      string
      string

      The content type of the image.

  • Position
    Position
    Position
    Position

    Gets the byte offset of the stream.

    public ulong Position { get; }public ulong Position { get; }Public ReadOnly Property Position As ulong

    Property Value

    • ulong
      ulong
      ulong
      ulong

      The number of bytes from the start of the stream.

  • Size
    Size
    Size
    Size

    Gets or sets the size of the device thumbnail image.

    public ulong Size { get; set; }public ulong Size { get; set; }Public ReadWrite Property Size As ulong

    Property Value

    • ulong
      ulong
      ulong
      ulong

      The size of the device thumbnail image.

Methods

  • CloneStream()
    CloneStream()
    CloneStream()
    CloneStream()

    Creates a new instance of a IRandomAccessStream over the same resource as the current stream.

    public IRandomAccessStream CloneStream()public IRandomAccessStream CloneStream()Public Function CloneStream() As IRandomAccessStream

    Returns

  • Close()
    Close()
    Close()
    Close()

    Closes the current stream and releases system resources.

    public void Close()public void Close()Public Function Close() As void
  • FlushAsync()
    FlushAsync()
    FlushAsync()
    FlushAsync()

    Flushes data asynchronously in a sequential stream.

    public IAsyncOperation<bool> FlushAsync()public IAsyncOperation<bool> FlushAsync()Public Function FlushAsync() As IAsyncOperation( Of bool )

    Returns

    • The stream flush operation.

  • GetInputStreamAt(System.UInt64)
    GetInputStreamAt(System.UInt64)
    GetInputStreamAt(System.UInt64)
    GetInputStreamAt(System.UInt64)

    Returns a pointer to an input stream starting at the specified location.

    public IInputStream GetInputStreamAt(System.UInt64)public IInputStream GetInputStreamAt(System.UInt64)Public Function GetInputStreamAt(System.UInt64) As IInputStream

    Parameters

    • position
      System.UInt64
      System.UInt64
      System.UInt64
      System.UInt64

      The position in the input stream.

    Returns

  • GetOutputStreamAt(System.UInt64)
    GetOutputStreamAt(System.UInt64)
    GetOutputStreamAt(System.UInt64)
    GetOutputStreamAt(System.UInt64)

    Returns a pointer to an output stream starting at the specified location.

    public IOutputStream GetOutputStreamAt(System.UInt64)public IOutputStream GetOutputStreamAt(System.UInt64)Public Function GetOutputStreamAt(System.UInt64) As IOutputStream

    Parameters

    • position
      System.UInt64
      System.UInt64
      System.UInt64
      System.UInt64

      The position in the output stream.

    Returns

  • ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions)
    ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions)
    ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions)
    ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions)

    Returns an asynchronous byte reader object.

    public IAsyncOperationWithProgress<IBuffer, uint> ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions)public IAsyncOperationWithProgress<IBuffer, uint> ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions)Public Function ReadAsync(Windows.Storage.Streams.IBuffer,System.UInt32,Windows.Storage.Streams.InputStreamOptions) As IAsyncOperationWithProgress( Of IBuffer, uint )

    Parameters

    Returns

    • The asynchronous operation.

  • Seek(System.UInt64)
    Seek(System.UInt64)
    Seek(System.UInt64)
    Seek(System.UInt64)

    Sets the position of the stream to the specified value.

    public void Seek(System.UInt64)public void Seek(System.UInt64)Public Function Seek(System.UInt64) As void

    Parameters

    • position
      System.UInt64
      System.UInt64
      System.UInt64
      System.UInt64

      The new position of the stream.

  • WriteAsync(Windows.Storage.Streams.IBuffer)
    WriteAsync(Windows.Storage.Streams.IBuffer)
    WriteAsync(Windows.Storage.Streams.IBuffer)
    WriteAsync(Windows.Storage.Streams.IBuffer)

    Writes data asynchronously in a sequential stream.

    public IAsyncOperationWithProgress<uint, uint> WriteAsync(Windows.Storage.Streams.IBuffer)public IAsyncOperationWithProgress<uint, uint> WriteAsync(Windows.Storage.Streams.IBuffer)Public Function WriteAsync(Windows.Storage.Streams.IBuffer) As IAsyncOperationWithProgress( Of uint, uint )

    Parameters

    Returns

    • The byte writer operation.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Devices.Enumeration.dll