I want to load a bitmap from URL and then use palette API to get some colors from that.
On the documentation page, I cannot find the code for getting bitmap directly!
Can anyone help me out?
I want to load a bitmap from URL and then use palette API to get some colors from that.
On the documentation page, I cannot find the code for getting bitmap directly!
Can anyone help me out?
Alireza Ghanbarinia
On
according to Coil's own document, you can download a bitmap in the background in the following way:
val request = ImageRequest.Builder(context)
.data(url)
.build()
val drawable = context.imageLoader.execute(request).drawable
You can use
targetmethod and cast the drawable tobitmapasIf you using coroutines then use
GetRequest(with overloadedexecutemethod withsuspend) in your CoroutineScope as: