---
name: "CameraContext.takePhoto"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "CameraContext.takePhoto"
---

## CameraContext.takePhoto

> [VERSION] Base Library >= 2.21.8

### Description

Take photo

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `option` | `CameraTakePhotoOption` | Yes | Photo options |

### Return Value

None


### Referenced Types

##### `interface` CameraTakePhotoOption

| Property | Type | Description |
| --- | --- | --- |
| `quality` | `"high" \| "normal" \| "low"` | Image quality: 'high' \| 'normal' \| 'low' |
| `selfieMirror` | `boolean` | Whether to enable selfie mirroring |
| `success` | `(result: Record<string, unknown>) => void` | Success callback |


### Examples

#### Take photo

```ts
const cameraCtx = ty.createCameraContext();
cameraCtx.takePhoto({
  quality: 'high',
  success(res) {
    console.log('Photo taken successfully', res.tempImagePath);
  },
});
```
