Enahor Tapmas
05/20/2024, 11:13 PMEnahor Tapmas
05/20/2024, 11:13 PMvar painterInfo = BitmapPainter(loadImageBitmap(File(IMG_NAME_ARR[min(anim , 120)]).inputStream()))
var size by remember { mutableStateOf(IntSize(1,1)) }
Box(modifier = Modifier.border(2.dp,Color.Green).fillMaxWidth().fillMaxHeight().onSizeChanged {
size = it
}) {
val x: BoxScope = this
Image(
painter = painterInfo,
null,
modifier = Modifier.height(size.height.dp).width(size.width.dp).border(2.dp, Color.Red),
contentScale = ContentScale.Fit
)
}
Text("${size.height} ${size.width}")
}
Chris Athanas
05/21/2024, 1:50 AMContentScale
Enahor Tapmas
05/21/2024, 3:54 AM