Skip to content

Instantly share code, notes, and snippets.

@prashantvc
Created August 4, 2014 09:16
Show Gist options
  • Save prashantvc/dbf2dae33c59b8dcc426 to your computer and use it in GitHub Desktop.
Save prashantvc/dbf2dae33c59b8dcc426 to your computer and use it in GitHub Desktop.
private Bitmap async GetImageBitmapFromUrl(string url)
{
Bitmap imageBitmap = null;
using (var webClient = new WebClient())
{
var imageBytes = await webClient.DownloadDataAsync(url);
if (imageBytes != null && imageBytes.Length > 0)
{
imageBitmap = BitmapFactory.DecodeByteArray(imageBytes, 0, imageBytes.Length);
}
}
return imageBitmap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment