user3593643 user3593643 - 1 year ago 439
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

Answer Source

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("");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download