Javokhir Savriev
06/08/2023, 6:54 AMMichael Paus
06/08/2023, 9:20 AMthis
is your ByteArray, your code is correct and works on compose desktop. But you have to make sure that this
actually contains valid image data like, e.g., the raw bytes of a JPG or PNG image. Not every possible image format is supported. So what do your bytes contain?Timo Drick
06/11/2023, 3:12 PMval imageInfo = ImageInfo(targetWidth, targetHeight, ColorType.BGRA_8888, ColorAlphaType.OPAQUE)
Make sure ColorType is matching your raw data.
And than you can create a bitmap with:
Bitmap().also {
it.allocPixels(imageInfo)
it.installPixels(byteArray)
}