Join Slack
Communities
Powered by
Hi! I'm starting to use kotlin multiplatform (andr...
# multiplatform
j
Jaqueline Steffenon
01/11/2023, 1:16 PM
Hi! I'm starting to use kotlin multiplatform (android and desktop), and I'm trying to put an image but I don't understand which folder to put the image file in and how to reference the image
h
hfhbd
01/11/2023, 5:25 PM
Put it in
commonMain/ressources
and use
painterRessource("logo.png")
hfhbd
01/11/2023, 5:26 PM
Here is a Desktop only sample:
https://github.com/hfhbd/oop-lab-ws17/blob/main/src/main/kotlin/fh/ws17/conterm/gui/View.kt
and
https://github.com/hfhbd/oop-lab-ws17/tree/main/src/main/resources
j
Jaqueline Steffenon
01/11/2023, 6:23 PM
Oh, I did something wrong in creating the resources folder. This solved the problem. Thank you!
m
Michael Paus
01/12/2023, 9:08 AM
But “resources” is spelled with just one “s”. Otherwise for desktop you can follow this official tutorial:
https://github.com/JetBrains/compose-jb/tree/master/tutorials/Image_And_Icons_Manipulations
2
Views
Open in Slack
Previous
Next