Getting Bitmap from Image using Glide in android

Anupam picture Anupam · Aug 18, 2017 · Viewed 19k times · Source

I want to get the bitmap from an image using Glide. I am doing the following -

Bitmap chefBitmap = Glide.with(MyActivity.this)
.load(chef_image)
.asBitmap()
.into(100, 100)
.get();

It used to work with the previous Glide version. But it does not work with this in gradle - "compile 'com.github.bumptech.glide:glide:4.0.0'"

I want to use this dependency because this is the latest version.

Can anyone help me in this regard. Thanks in advance.

Answer

Anand Khinvasara picture Anand Khinvasara · Sep 13, 2017
Bitmap chefBitmap = Glide.with(MyActivity.this)
.asBitmap()
.load(chef_image)
.submit()
.get();