How do I load an image from URL: Trying out like t...
# compose-desktop
h
How do I load an image from URL: Trying out like this doesn't work! I've added the following dependencies, but still gives me compile error:
Copy code
val skijaArtifact = "skija-linux"
val skijaVersion = "0.93.1"

dependencies {
    implementation(compose.desktop.currentOs)
    api ("org.jetbrains.skija:${skijaArtifact}:${skijaVersion}")
}
I'm using the following version of compose:
Copy code
plugins {
    kotlin("jvm") version "1.6.10"
    id("org.jetbrains.compose") version "1.0.1-rc2"
}
h
Like this?
Copy code
suspend fun downloadImage(url: String): ImageBitmap {
    val image = imageClient.get<ByteArray>(url)
    return loadImageBitmap(ByteArrayInputStream(image))
  }
o
Link above has ready to use samples
s
there is Kamel that already implement this for Compose Desktop https://github.com/alialbaali/Kamel
❤️ 1
149 Views