Created
August 4, 2014 09:16
-
-
Save prashantvc/dbf2dae33c59b8dcc426 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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