Hi all - don't mean to be a bother, I've been poki...
# compose
i
Hi all - don't mean to be a bother, I've been poking away at trying to get an image from OpenCV drawn on the screen in Jetpack Compose. I've gotten it into a ByteArray, installed the pixels in a skia bitmap and whenever I try drawing it either with drawImage() in a canvas or just Image() composable my entire program crashes with a native stack trace. Is there something obvious I'm missing here or that I'm forgetting to do? The array and bitmap looks to be valid and .readyToDraw reports true, I just can't draw it.. the JNI stuff is way over my head 😭
1
r
RGB_888x requires 4 bytes per pixel, you are supplying 3
❤️ 2
i
thank you so much
that was it, just had openCV convert it to RGBA instead of RGB and all good
I have been at this for hours
r
Skia doesn’t support 24 bit image types so if that’s what you are getting from OpenCV you’ll need to add an extra byte to each pixel
👍 1