public suspend fun ImageLoader.loadImage( context: Context, data: Any?, configurer: ImageRequest.Builder.() -> Unit = {} ): Bitmap? { val request = ImageRequest.Builder(context) .data(data) .apply(configurer) .allowRgb565(true) .allowHardware(false) .build() val response = execute(request) return (response.drawable as? BitmapDrawable)?.bitmap }
Load a Bitmap from a CoilImage loader.