> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/device/captureimage.md).

# captureImage

## Description

Activates the camera of the mobile device to capture image.

## Input / Parameter

| Name    | Description                                                                             | Input Type | Default | Options | Required                                |
| ------- | --------------------------------------------------------------------------------------- | ---------- | ------- | ------- | --------------------------------------- |
| quality | The quality of the saved image. (Ranging from 0-100, where 100 is the full resolution.) | Number     | -       | -       | Yes                                     |
| height  | The height to scale the image to, in pixels.                                            | Number     | -       | -       | Partial (Yes if 'width is provided'.)   |
| width   | The width to scale the image to, in pixels.                                             | Number     | -       | -       | Partial (Yes if 'height' is provided'.) |

## Output

N/A

## Callback

### callback

The function to be executed if the camera captures an image successfully.

### errorCallback

The function to be executed if the camera does not capture an image successfully.

## Video

Coming Soon.

## Example

The user wants to take a photo using their mobile device and view the photo in the image component.

### Steps

| No. | Description                      |                                                                                                                                                                                                           |
| --- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1.  | ![](/files/IfamIxU8SSSGa9f4FOOU) | Drag an image and a button component to a page in the mobile designer.                                                                                                                                    |
| 2.  | ![](/files/4OG0SbehygvUMFW3j1mF) | Select the event `click` for the button and drag the function `captureImage` to the event flow.                                                                                                           |
| 3.  | ![](/files/4Aw2WEZ8lNfYwnrBrvoU) | Fill in the parameters of the function.                                                                                                                                                                   |
| 4.  | ![](/files/Qc1zHoyuFoYGnmSWmuYH) | Drag the the function to be executed if the image is captured successfully to the node below the function. In this example, we are using the `setComponentValue` to set the image to the image component. |
| 5.  | ![](/files/siIWy9YXboBOjIsVU7MI) | Fill in the parameters of the function.                                                                                                                                                                   |

### Result

The image captured will be shown in the image component.

## Links
