hi all, is there any straightforward way to show i...
# compose
m
hi all, is there any straightforward way to show image with custom width and height? currently I am using
SimpleImage
wrapped inside a
Container
. code like this
Copy code
Container(width = 62.dp, height = 42.dp) {
                SimpleImage(image = image)
            }
b
how about copying the SimpleImage implementation and tweaking it?
Copy code
@Composable
fun SimpleImage(
    image: Image,
    tint: Color? = null
) {
    // TODO b/132071873: WithDensity should be able to use the DSL syntax
    WithDensity(block = {
        Container(width = image.width.toDp(), height = image.height.toDp()) {
            DrawImage(image, tint)
        }
    })
}
m
I think that could work, lemme try, thanks
a
m
Thanks, looking at it now