I am creating a vector drawable as background and I want to add an image on that vector such that the image only shows the portion that is over the vector and the other part just clips out.
Image
Sample Image
Box{
Image(painter = painterResource(id = R.drawable.profile)
,contentDescription = null,
modifier = Modifier
.align(Alignment.TopEnd)
.offset(x = 100.dp, y = (-100).dp))
Image(painter = painterResource(id = R.drawable.luffy)
,contentDescription = "Luffy",
Modifier
.size(300.dp)
.align(Alignment.TopEnd)
.offset(x = 70.dp, y = (-50).dp))
}
This is the code and output is:-
Output