Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. private Android.Graphics.Bitmap GetImageBitmapFromUrl(string url)
  2. {
  3. Android.Graphics.Bitmap imageBitmap = null;
  4.  
  5. using (var webClient = new WebClient())
  6. {
  7. var imageBytes = webClient.DownloadData(url);
  8. if (imageBytes != null && imageBytes.Length > 0)
  9. {
  10. imageBitmap = BitmapFactory.DecodeByteArray(imageBytes, 0, imageBytes.Length);
  11. }
  12. }
  13.  
  14. return imageBitmap;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement