2017-02-13 2 views
0

Ich habe ein Problem als Glide-Unterstützung für gif Ich benutze Gif als Thumnail und Lade URL zu Imageview. Problem ist, ich möchte die Bitmap von imageview in neuen SimpleTarget.Bitmap von gleiten mit gif thumbnail

Hier ist mein Code.

Glide.with(getApplicationContext()).load(url) 
.thumbnail(Glide.with(getApplicationContext()).load(R.drawable.preloader)) 
.fitCenter() 
.crossFade() 
.into(Want bitmap here is it possible); 

Antwort

1

Versuchen Sie, den folgenden Code:

Glide.with(this) 
      .load(url) 
      .asBitmap() 
      .placeholder(new ColorDrawable(ContextCompat.getColor(MainActivity.this, R.color.placeholder))) 
      .error(new ColorDrawable(ContextCompat.getColor(MainActivity.this, R.color.placeholder))) 
      .dontAnimate() 
      .into(new SimpleTarget<Bitmap>() { 
       @Override 
       public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) { 
        // resource: the required Bitmap 
       } 
      }); 
+0

Nicht working.But fand ich die Antwort, dass sie das gleiche Bild verwenden, wenn Sie es an der Zeit senden rufen, so benutzte ich gleiten wieder mit asBitmap(). –