Dragos Rachieru
06/02/2022, 4:30 PMDragos Rachieru
06/02/2022, 4:35 PM1.2.0-alpha01-dev683
, I'll try updating to 686
right nowDragos Rachieru
06/02/2022, 4:38 PMobject Versions {
//not used yet
// const val serialization = "1.3.3"
const val coroutines = "1.6.2"
const val ktor = "2.0.2"
const val okio = "3.1.0"
const val kotlin = "1.6.21"
const val compose = "1.2.0-alpha01-dev683"
const val app = "0.0.1"
}
Igor Demin
06/02/2022, 4:40 PMorg.jetbrains.skia
package is available only in desktopMain
sourceSetDragos Rachieru
06/02/2022, 4:43 PMImageBitmap
?Dragos Rachieru
06/02/2022, 4:44 PMIgor Demin
06/02/2022, 4:51 PMHmm, how should I convert an image from `ByteArray`(coming from a png like for example) to anCreate an expect/actual function. BitmapDecoder.kt in commonMain:?ImageBitmap
expect fun ImageBitmap(bytes: ByteArray): ImageBitmap
BitmapDecoderDesktop.kt in desktopMain:
actual fun ImageBitmap(bytes: ByteArray): ImageBitmap {
// your code from the screenshot
}
BitmapDecoderAndroid.kt in androidMain:
actual fun ImageBitmap(bytes: ByteArray): ImageBitmap {
return BitmapFactory.decodeByteArray(bytes, 0, bytes.length).asImageBitmap()
}
Dragos Rachieru
06/02/2022, 4:59 PMIgor Demin
06/02/2022, 5:06 PMDragos Rachieru
06/02/2022, 5:11 PMLucas
06/02/2022, 5:47 PMLucas
06/02/2022, 5:50 PMorg.jetbrains.skia
is available on the common source set, and lets you use it. But as @Dragos Rachieru mentioned, it only compiles for desktop.Dragos Rachieru
06/02/2022, 6:07 PMDragos Rachieru
06/02/2022, 6:07 PMDragos Rachieru
06/02/2022, 6:08 PMLucas
06/02/2022, 6:09 PMDragos Rachieru
06/02/2022, 6:09 PMDragos Rachieru
06/02/2022, 6:10 PMLucas
06/02/2022, 6:13 PMDragos Rachieru
06/02/2022, 6:13 PMwip
tho, it supports only Url
for now