How would I convert other icons to compose desktop...
# compose-desktop
m
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
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
m
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
I use this method: painterResource
121 Views