Hello, is there a way to resize a `Bitmap`/`Image` using compose? I'm creating a multiplatform image...
d
Hello, is there a way to resize a `Bitmap`/`Image` using compose? I'm creating a multiplatform image loading library that reads a
ByteArray
using ktor and then creates an image using
Image.makeFromEncoded
. I have to resize the result, but I don't know if I can do this using `compose`/`skiko`
a
There is no multiplatform API but you can scale the image using platform API.
For Android you can use
Bitmap.createScaledBitmap()
and for desktop you can use
image.scalePixels()
(and then
Bitmap.makeFromImage(Image.makeFromPixmap(pixmap))
).
d
I don't know what to do for iOS and web
525 Views