user3593643 user3593643 - 1 month ago 20x
Android Question

Load image from url to ImageView - C#

I want to load an image from url to imageview in c# ( android programming ) after search in google i cant find any good result , thank you for helping

i am using xamarin studio


The very first hit I got from Google was a thread on the Xamarin forums discussing this exact issue:

private Bitmap GetImageBitmapFromUrl(string url)
     Bitmap imageBitmap = null;

     using (var webClient = new WebClient())
          var imageBytes = webClient.DownloadData(url);
          if (imageBytes != null && imageBytes.Length > 0)
               imageBitmap = BitmapFactory.DecodeByteArray(imageBytes, 0, imageBytes.Length);

     return imageBitmap;

var imageBitmap = GetImageBitmapFromUrl("");