# ImageBitmap
>![](../../public_sys-resources/icon-note.gif) **NOTE:**
>This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
**ImageBitmap** allows you to add an image bitmap.
## APIs
ImageBitmap\(src: string\)
- Parameters
Name
|
Type
|
Mandatory
|
Default Value
|
Description
|
src
|
string
|
Yes
|
-
|
Path of the image bitmap object.
|
## Attributes
Attribute
|
Type
|
Default Value
|
Mandatory
|
Description
|
width
|
Length
|
0px
|
No
|
Image width.
|
height
|
Length
|
0px
|
No
|
Image height.
|
Example
```
@Entry
@Component
struct DrawImageExample {
private settings:RenderingContextSettings = new RenderingContextSettings(true)
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
private img:ImageBitmap = new ImageBitmap("common/images/example.jpg")
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Canvas(this.context)
.width('100%')
.height('100%')
.backgroundColor('#ffff00')
.onReady(() =>{
this.context.drawImage( this.img,0,0,400,200)
})
}
.width('100%')
.height('100%')
}
}
```
![](figures/en-us_image_0000001192595194.png)