コード例 #1
0
        //imageView.SetImageURI(Android.Net.Uri.Parse(""));
        public static async Task <Bitmap> LoadImage(string imageUrl, ImageView view = null)
        {
            Bitmap image = null;

            try
            {
                byte[] contents = await SL.LoadImage(imageUrl);

                image = BitmapFactory.DecodeByteArray(contents, 0, contents.Length);
                if (view != null)
                {
                    view.SetImageBitmap(image);
                    //view.RequestLayout();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(@"              ERROR {0}", ex.Message);
            }
            return(image);
        }