Given: `painterResource(<http://R.drawable.my|R.dr...
# compose
t
Given:
painterResource(<http://R.drawable.my|R.drawable.my>_resource)
Is it possible to get any sizing info about the resource? In particular, I want to know the aspect ratio of width / height (so I don't really care what units the width|height would be)
a
.intrinsicSize
should get you there. The only two possibilities for a painter resource would be bitmap or vector I think, and both
BitmapPainter
and
VectorPainter
would return a proper size, not Size.Unspecified
e
some painters may be unsized in one or both dimensions, and https://google.github.io/accompanist/drawablepainter/ may return some. but yes,
androidx.compose.ui.res.painterResource()
only supports bitmap and vector drawables, which are finite sized