How can i save a `ImageBitmap` to a file and later...
# multiplatform
v
How can i save a
ImageBitmap
to a file and later share that file in KMP?
a
You can take expect/actual implementation from here
v
Thanks, and how can I write to a file and then share it ? on Android and iOS
a
you have image bytes, do with it everything you want. you can use okio to write files
v
I'm trying this
Copy code
val bytes = Image.makeFromBitmap(image.asSkiaBitmap()).encodeToData()?.bytes!!
But getting this error
kotlin.RuntimeException: Failed to Image::makeFromBitmap Bitmap(_ptr=0x0x6000017d89c0)
403 Views