Files
AndroidJetpack/Jetpack-Compose-Playground/docs/foundation/image.md
T
2026-07-15 16:57:36 +08:00

625 B

Image

Image is used to display Images. It's similar to an ImageView in the classic Android View system.

Load Image

You can use painterResource to load an image from the resources

@Composable
fun ImageResourceDemo() {
    val image: Painter = painterResource(id = R.drawable.composelogo)
    Image(painter = image,contentDescription = "")
}

See also:

  • [Full Example Code]({{ site.samplefolder }}/foundation/ImageResourceDemo.kt)