---
title: "imageResource"
description: "Load an ImageBitmap from an image resource.

This function is intended to be used for when low-level ImageBitmap-specific functionality is
required. For simply displaying onscreen, the vector/bitmap-agnostic [painterResource] is
recommended instead."
type: "composable"
---

<div class='type'>Composable Function</div>


<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>


```kotlin
@Composable
fun ImageBitmap.Companion.imageResource(@DrawableRes id: Int): ImageBitmap
```


Load an ImageBitmap from an image resource.

This function is intended to be used for when low-level ImageBitmap-specific functionality is
required. For simply displaying onscreen, the vector/bitmap-agnostic `painterResource` is
recommended instead.

#### Parameters

| | |
| --- | --- |
| id | the resource identifier |


#### Returns

| | |
| --- | --- |
|  | the decoded image data associated with the resource |





