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

John Dior

09/28/2023, 5:14 AM
This ... should not be so hard. I simply want to load an SVG in from a byte array but for some reason thats not possible??? I know i might need skia but none of the methods that they say exist here
solved 1
r

romainguy

09/28/2023, 5:25 AM
Skia is an implementation detail. It's the 2D rendering engine and not exposed directly.
j

John Dior

09/28/2023, 5:30 AM
is there a way to create an image vector?
r

romainguy

09/28/2023, 5:35 AM
I believe you can use
loadSvgPainter()
to load from a byte array (via an input stream), and
painterResource()
to load from a file
j

John Dior

09/28/2023, 5:38 AM
so i am trying painterResource and it just says
Copy code
val bitmap = painterResource("pause.svg")
                    Icon(bitmap, null)
image.png
pause.svg
r

romainguy

09/28/2023, 5:40 AM
If all you need is a pause icon you can use the extended set of material icons with the artifact
androidx.compose.material:material-icons-extended
j

John Dior

09/28/2023, 5:42 AM
ive been trying
i cant find it
Do you know what i need to import?
r

romainguy

09/28/2023, 5:43 AM
Are you writing an Android or a desktop app btw?
SVG is supported by desktop (afaik), not Android
j

John Dior

09/28/2023, 5:44 AM
both
im on compose multiplatform
and what the hell?
I can get like 50 svg viewers on android but they dont work with this ui framework??? the same SVG thats like everywhere?
im begenning to see why no one in an enterprise environment would give this framework the time of day
regardless, I JUST want a pause button, but for some dumb reason, this framework is making me spend hours of time JUST TO GET A PAUSE button. This is legitimately rediculous
ALRIGHT FINALLY GOT IT , ty for the help
r

romainguy

09/28/2023, 6:03 AM
Android uses something called Vector Drawables, also saved as XML files, that you can create from SVG in Android Studio
Those files are also supported by desktop
r

Rafs

09/28/2023, 6:11 AM
Damn, Romain should be awarded as the most tolerant human on earth. @John Dior Learn the basics and don't come here next time acting like an idiot. It's a public space and you should learn some basic courtesy. You made senseless remarks earlier on, he tolerated you but you have the audacity to follow it up with more piles of garbage.
❤️ 2
💯 21
2 Views