Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StandardDataFormats.Bitmap | bitmap property

Applies to Windows and Windows Phone

A read-only property that returns the format ID string value corresponding to the Bitmap format.

Syntax


var bitmap = Windows.ApplicationModel.DataTransfer.StandardDataFormats.bitmap;

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The format ID string value corresponding to the Bitmap format.

Examples

This example demonstrates the use of the Bitmap property. To use the code in this example, add an event listener to your app to handle the activated event. Then put this code in the function that this event listener calls.


function registerForShare() {
    var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
    dataTransferManager.addEventListener("datarequested", shareImageHandler);
}

function shareImageHandler(e) {
    var request = e.request;
    request.data.properties.title = "Share Image Example";
    request.data.properties.description = "A demonstration that shows how to share an image.";
    var deferral = request.getDeferral();
    Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("images\\smalllogo.png").then(function (thumbnailFile) {
        request.data.properties.thumbnail = Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(thumbnailFile);
        return Windows.ApplicationModel.Package.current.installedLocation.getFileAsync("images\\logo.png");
    }).done(function (imageFile) {
        request.data.setBitmap(Windows.Storage.Streams.RandomAccessStreamReference.createFromFile(imageFile));
        deferral.complete();
    }, function (err) {
        request.failWithDisplayText(err);
    });
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.ApplicationModel.DataTransfer
Windows::ApplicationModel::DataTransfer [C++]

Metadata

Windows.winmd

See also

StandardDataFormats

 

 

Show:
© 2014 Microsoft