https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
m

martmists

10/19/2023, 7:00 PM
How would I convert other icons to compose desktop? The Compose documentation says to just add the drawables and use R, but that's not present on desktop. Is there a guide on converting the SVG path data from XML to the
materialIcon
builder?
e

ephemient

10/19/2023, 7:06 PM
compose material icons uses https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/material/material/icons/generator/src/main/kotlin/androidx/compose/material/icons/generator/ImageVectorGenerator.kt to convert android vector drawables to compose painters at build time, and there's tooling in the android sdk to convert svgs to avds
i

iXPert12

10/20/2023, 5:16 AM
m

Michael Paus

10/20/2023, 8:24 AM
Have you checked https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Image_And_Icons_Manipulations Is
painterResource()
not enough for you? From the docs: “`painterResource` supports raster (BMP, GIF, HEIF, ICO, JPEG, PNG, WBMP, WebP) and vector formats (SVG, XML vector drawable).”
t

Tsung Wu

10/20/2023, 2:16 PM
I use this method: painterResource
14 Views