Dela via


DataPackage.SetBitmap(RandomAccessStreamReference) Method

Definition

Sets the bitmap image contained in the DataPackage.

public:
 virtual void SetBitmap(RandomAccessStreamReference ^ value) = SetBitmap;
void SetBitmap(RandomAccessStreamReference const& value);
public void SetBitmap(RandomAccessStreamReference value);
function setBitmap(value)
Public Sub SetBitmap (value As RandomAccessStreamReference)

Parameters

value
RandomAccessStreamReference

A stream that contains the bitmap image.

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();
}

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.

Applies to