Reputation: 73
I would like to create bitmap
from imageUrl.
I have tried some solutions, but nothing works. How do you make it in Kotlin?
bitMap = Glide
.with(requireContext())
.asBitmap()
.load(imageUrlUri)
error
Type mismatch.
Required:
Bitmap?
Found:
RequestBuilder<Bitmap!>
Upvotes: 0
Views: 1011
Reputation: 845
This method has been deprecated, but maybe help you:
bitmap = BitmapAsync().execute(your_image_url).get()!!
It will return you a bitmap.
Upvotes: 0
Reputation: 10493
Try this:
bitMap = Glide
.with(requireContext())
.asBitmap()
.load(imageUrl)
.submit()
.get()
Upvotes: 1