Download the image from the azure blob repository and upload it

I work with Xamarin formats, and I saved the image in Azure blob memory, which I would like to load on page loading and put in the image, at the moment I have this code:

using(var fileStream = imageStore.GetStream())
{
     blockBlob.DownloadToStreamAsync(fileStream);
}

This code should upload the image to the file stream (Please let me know if I am mistaken), but then I need to get the image from this file stream and set it as the image source, but I don’t know Know how to do this.

+6
source share
1 answer

Image.Source ImageSource.FromStream:

using (var fileStream = new MemoryStream())
{
    await blockBlob.DownloadToStreamAsync(fileStream);
    image.Source = ImageSource.FromStream(() => fileStream);
}

: DownloadToStreamAsync a Task, await it...

+4

All Articles