https://kotlinlang.org logo
#compose
Title
# compose
d

Dragos Rachieru

05/16/2022, 11:35 AM
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

Albert Chang

05/16/2022, 1:14 PM
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

Dragos Rachieru

05/19/2022, 5:43 AM
I don't know what to do for iOS and web
98 Views