rawPainterResource

Create a Painter from an Android resource id. This can load an instance of BitmapPainterfor ImageBitmap based assets. The resources with the given id must point to either fully rasterized images (ex. PNG or JPG files)s.

Example:

Return

Painter used for drawing the loaded resource

Parameters

id

Resources object to query the image file from

Samples

androidx.compose.ui.samples.PainterResourceSampleandroidx.compose.ui.samples.AndroidDrawableInDrawScopeSample