Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 233
nwagu Avatar asked Sep 18 '25 12:09

nwagu


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"
)
like image 149
Gabriele Mariotti Avatar answered Sep 21 '25 01:09

Gabriele Mariotti