开发 API 多媒体 相机 CameraContext CameraContext.takePhoto
# CameraContext.takePhoto
更新时间:2024-09-18 14:46:38
拍摄照片。
# takePhoto(options: CameraTakePhotoOptions): Promise<CameraTakePhotoResult>
# 参数
| 参数 | 类型 | 必填 |
|---|---|---|
| options | CameraTakePhotoOptions | 是 |
# CameraTakePhotoOptions
属性
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| quality | 'normal' | 'high' | 'low' | 'normal' | 否 | 成像质量 |
| success | (result: CameraTakePhotoResult) => void | 否 | 接口调用成功的回调函数 | |
| fail | (error: APIError) => void | 否 | 接口调用失败的回调函数 | |
| complete | (resultOrError: CameraTakePhotoResult | APIError) => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
# 返回值
# Promise<CameraTakePhotoResult>
CameraTakePhotoResult
属性
| 属性 | 类型 | 说明 |
|---|---|---|
| tempImagePath | string | 照片文件的本地临时路径 |
# 示例代码
上一篇:《CameraContext.stopRecord》
下一篇:《CameraFrameListener》
仍有疑问? 前往社区提问