我在桌面版 kotlin compose 中加载图像时遇到问题
它给出了以下错误:
找不到 image.png 资源
我在项目的 src 文件夹中有文件
我不确定问题是否出在代码或我导入图像的方式上,或者即使问题是 kotlin compose for desktop 仍处于实验性质
val imageModifier = Modifier
.height(240.dp)
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))
Image(bitmap = useResource("image.png") { loadImageBitmap(it) },
"image",
imageModifier,
contentScale = ContentScale.Fit)