DataPackageView.GetBitmapAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene l'immagine bitmap contenuta in DataPackageView
public:
virtual IAsyncOperation<RandomAccessStreamReference ^> ^ GetBitmapAsync() = GetBitmapAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<RandomAccessStreamReference> GetBitmapAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<RandomAccessStreamReference> GetBitmapAsync();
function getBitmapAsync()
Public Function GetBitmapAsync () As IAsyncOperation(Of RandomAccessStreamReference)
Restituisce
Flusso contenente l'immagine bitmap.
- Attributi
Esempio
if (shareOperation.data.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.bitmap)) {
if (shareOperation.data.properties.thumbnail) {
shareOperation.data.properties.thumbnail.openReadAsync().then(function (thumbnailStream) {
var thumbnailBlob = MSApp.createBlobFromRandomAccessStream(thumbnailStream.contentType, thumbnailStream);
var thumbnailUrl = URL.createObjectURL(thumbnailBlob, false);
// To display the thumbnail, you need an element with id of "thumbnail"
// in your HTML page.
document.getElementById("thumbnail").src = thumbnailUrl;
});
}
shareOperation.data.getBitmapAsync().then(function (streamRef) {
streamRef.openReadAsync().then(function (bitmapStream) {
if (bitmapstream) {
var blob = MSApp.createBlobFromRandomAccessStream(bitmapStream.contentType, bitmapstream);
var imageUrl = URL.createObjectURL(blob, false);
// To display the image, you need an element with id of "imageholder"
// in your HTML page.
document.getElementById("imageholder").src = imageUrl;
}
});
});
}
shareOperation.reportCompleted();