I want to set a shape drawable to an image in compose, the drawable look like this cureved_rect.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FBCCBD" />
<corners android:radius="8dp" />
</shape>
I try the below snipet to load the shape
Image(painter = painterResource(id = R.drawable.cureved_rect),
contentDescription = null,
modifier = Modifier
.padding(32.dp)
.fillMaxWidth()
.height(200.dp)
.constrainAs(image) {
top.linkTo(parent.top)
start.linkTo(parent.start)
end.linkTo(parent.end)
})
But it is not working, the app crash with an exception java.lang.IllegalArgumentException:Only VectorDrawables and rasterised asset types are supported ex PNG,JPG 1 . How to load shape drawable in compose 2 . Load colour resource in the compose image
