https://kotlinlang.org logo
Title
s

spierce7

11/24/2020, 12:18 AM
Is there any way to deal with image resolution for screen DPI inside desktop compose yet? Images show larger on my 1080p monitor vs my laptop retina screen.
j

Javier

11/24/2020, 12:38 AM
.dp
is not working?
s

spierce7

11/24/2020, 2:36 AM
No, it does. I’m currently just using the highest resolution image, and then setting the size of the image explicitly. Just curious if there is a image bucket solution for desktop. Maybe it performs well enough without it, and desktop app size is less of a concern than mobile.
t

Timo Drick

11/24/2020, 2:40 AM
Do you have something in mind like in Android with different resource folders for different screen DPI values? Maybe it is better to try to use vector graphics.
s

spierce7

11/24/2020, 2:47 AM
Do you have something in mind like in Android
I have nothing in mind. I’m just asking when I come across something I’m uncertain about. I’d say 60% of the time I learn something useful or interesting.
Maybe it is better to try to use vector graphics.
SVGs aren’t supported at the moment. The vector graphics in compose lib are also hard coded.
s

suresh

11/24/2020, 6:55 AM
This might be useful. You can convert svg to composable using - https://github.com/DevSrSouza/svg-to-compose
s

spierce7

11/24/2020, 1:11 PM
I didn’t know that! Thanks @suresh!