Enahor Tapmas
var 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
ContentScale
A modern programming language that makes developers happier.