DataPackage.SetBitmap | setBitmap method

Applies to Windows and Windows Phone

Sets the bitmap image contained in the DataPackage.

Syntax


public void SetBitmap(
  RandomAccessStreamReference value
)

Parameters

value

Type: RandomAccessStreamReference

A stream that contains the bitmap image.

Remarks

This method sets the value for StandardFormats.Bitmap.

Bitmap is one of the data types that the DataPackage object supports directly. See the StandardDataFormats class for information on other supported data types.

Examples

The following example uses the setBitmap method to share an image with a target app.


void DataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
    DataRequestDeferral deferral = e.Request.GetDeferral();
    e.Request.Data.Properties.Title = "Hello World!";
    e.Request.Data.Properties.Description = "This example shows how to share files and images.";
    if (this.dataPackageThumbnail != null)
    {
        e.Request.Data.Properties.Thumbnail = this.dataPackageThumbnail;
    }
    e.Request.Data.SetBitmap(imageStreamRef);
    deferral.Complete();
}


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

DataPackage

 

 

Show:
© 2014 Microsoft