Is there a way to load image as bitmap to Glide
For version 4 you have to call asBitmap()
before load()
GlideApp.with(itemView.getContext())
.asBitmap()
.load(data.getImageUrl())
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {}
});
}
More info: http://bumptech.github.io/glide/doc/targets.html
This solution is working with Glide V4. You can get the bitmap like this:
Bitmap bitmap = Glide
.with(context)
.asBitmap()
.load(uri_File_String_Or_ResourceId)
.submit()
.get();
Note: this will block the current thread to load the image.