Is there any way to do this in a pure Compose (and...
# compose
m
Is there any way to do this in a pure Compose (and therefore platform independent) way without having to resort to Android (or whatever the current platform is)?
Copy code
val buffer = IntArray(width * height)
// do some processing on buffer.
val outputImage = ImageBitmap(width, height, ImageBitmapConfig.Argb8888, true, ColorSpaces.Srgb)
outputImage.asAndroidBitmap().setPixels(buffer, 0, width, 0, 0, width, height)
Ideally there should be an
ImageBitmap
constructor which directly takes an
IntArray
as an argument. Or am I just missing something. If you can get such a buffer via
readPixels
from an
ImageBitmap
why is there then no way to feed that back into an image?