Hello! How can I make image from byte array?
# compose
p
Hello! How can I make image from byte array?
K 1
m
Is that what you are looking for? This assumes the bytes contain the encoded image data of a PNG, JPG, etc.
Copy code
fun imageBitmapFromBytes(encodedImageData: ByteArray): ImageBitmap {
    return BitmapFactory.decodeByteArray(encodedImageData, 0, encodedImageData.size).asImageBitmap()
}
p
That is exactly what i was looking for. Thanks Michael!
1249 Views