How can I display a base64-encoded image in Jetpack Compose without using external libs

Viewed 765

I could convert the base64 string to android.graphics.Bitmap but from all I can find online, I still need coil or glide to display it

1 Answers

If you have a Bitmap you can use the .asImageBitmap() extension to get a Compose ImageBitmap object.

Then use it in an Image composable.

Image(
    bitmap = bitmap.asImageBitmap(),
    contentDescription = "contentDescription"
)
Related