public unsafe BitmapDrawableResource(global::Android.Graphics.Drawables.BitmapDrawable p0, global::Com.Bumptech.Glide.Load.Engine.Bitmap_recycle.IBitmapPool p1) : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer) { if (Handle != IntPtr.Zero) { return; } try { JValue *__args = stackalloc JValue [2]; __args [0] = new JValue(p0); __args [1] = new JValue(p1); if (GetType() != typeof(BitmapDrawableResource)) { SetHandle( global::Android.Runtime.JNIEnv.StartCreateInstance(GetType(), "(Landroid/graphics/drawable/BitmapDrawable;Lcom/bumptech/glide/load/engine/bitmap_recycle/BitmapPool;)V", __args), JniHandleOwnership.TransferLocalRef); global::Android.Runtime.JNIEnv.FinishCreateInstance(Handle, "(Landroid/graphics/drawable/BitmapDrawable;Lcom/bumptech/glide/load/engine/bitmap_recycle/BitmapPool;)V", __args); return; } if (id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_ == IntPtr.Zero) { id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_ = JNIEnv.GetMethodID(class_ref, "<init>", "(Landroid/graphics/drawable/BitmapDrawable;Lcom/bumptech/glide/load/engine/bitmap_recycle/BitmapPool;)V"); } SetHandle( global::Android.Runtime.JNIEnv.StartCreateInstance(class_ref, id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_, __args), JniHandleOwnership.TransferLocalRef); JNIEnv.FinishCreateInstance(Handle, class_ref, id_ctor_Landroid_graphics_drawable_BitmapDrawable_Lcom_bumptech_glide_load_engine_bitmap_recycle_BitmapPool_, __args); } finally { } }
public void LoadImageDirectly(Uri uri) { var webClient = new WebClient(); MWCApp.LogDebug("Get speaker image directly, bypassing the ImageLoader which is taking too long"); webClient.DownloadDataCompleted += (sender, e) => { try { //var image = new global::Android.Graphics.Drawables.BitmapDrawable(bitmap); var byteArray = e.Result; MemoryStream ms = new MemoryStream(byteArray, 0, byteArray.Length); ms.Write(byteArray, 0, byteArray.Length); ms.Position = 0; var d = new global::Android.Graphics.Drawables.BitmapDrawable(ms); RunOnUiThread(() => { MWCApp.LogDebug("DETAILS speaker.ImageUrl"); imageview.SetImageDrawable(d); }); } catch (Exception ex) { MWCApp.LogDebug("Image error: " + ex); } }; webClient.DownloadDataAsync(uri); }
public void LoadImageDirectly(Uri uri) { var webClient = new WebClient(); MWCApp.LogDebug("Get speaker image directly, bypassing the ImageLoader which is taking too long"); webClient.DownloadDataCompleted += (sender, e) => { try { //var image = new global::Android.Graphics.Drawables.BitmapDrawable(bitmap); var byteArray = e.Result; MemoryStream ms = new MemoryStream(byteArray, 0, byteArray.Length); ms.Write(byteArray, 0, byteArray.Length); ms.Position = 0; var d = new global::Android.Graphics.Drawables.BitmapDrawable(ms); RunOnUiThread(() => { MWCApp.LogDebug("DETAILS speaker.ImageUrl"); imageview.SetImageDrawable(d); }); } catch (Exception ex) { MWCApp.LogDebug("Image error: " + ex); } }; webClient.DownloadDataAsync(uri); }
public static unsafe global::Com.Facebook.Drawee.Drawable.RoundedBitmapDrawable FromBitmapDrawable(global::Android.Content.Res.Resources res, global::Android.Graphics.Drawables.BitmapDrawable bitmapDrawable) { const string __id = "fromBitmapDrawable.(Landroid/content/res/Resources;Landroid/graphics/drawable/BitmapDrawable;)Lcom/facebook/drawee/drawable/RoundedBitmapDrawable;"; try { JniArgumentValue *__args = stackalloc JniArgumentValue [2]; __args [0] = new JniArgumentValue((res == null) ? IntPtr.Zero : ((global::Java.Lang.Object)res).Handle); __args [1] = new JniArgumentValue((bitmapDrawable == null) ? IntPtr.Zero : ((global::Java.Lang.Object)bitmapDrawable).Handle); var __rm = _members.StaticMethods.InvokeObjectMethod(__id, __args); return(global::Java.Lang.Object.GetObject <global::Com.Facebook.Drawee.Drawable.RoundedBitmapDrawable> (__rm.Handle, JniHandleOwnership.TransferLocalRef)); } finally { } }