Код: Выделить всё
@Composable
fun Item(
imageResId: Int,
parallaxOffset: Float,
pagerHeight: Dp,
screenWidth: Dp,
density: Float,
scaleFactor: Float,
modifier: Modifier = Modifier,
imageCornerRadius: Dp = 24.dp,
imageHeight: Dp = 250.dp,
) {
// Load the image bitmap
val imageBitmap = ImageBitmap.imageResource(id = imageResId)
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
// Card composable for the item
Box(modifier = modifier
.graphicsLayer {
scaleX = scaleFactor
scaleY = scaleFactor
}
.clip(RoundedCornerShape(imageCornerRadius))) {
Canvas(
modifier = Modifier
.fillMaxWidth()
.height(250.dp)
.clip(shape)
) {)
translate(left = parallaxOffset * density) {
// Draw the image
drawImage(
image = imageBitmap,
dstOffset = IntOffset(-xOffset.toIntPx(density), 0),
)
}
}
}
}
}

Подробнее здесь: https://stackoverflow.com/questions/772 ... -drawimage