Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
aeacb36a
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aeacb36a
编写于
10月 17, 2022
作者:
J
jiangminyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed with sdk d.ts.
Signed-off-by:
N
jiangminyang
<
jiangminyang@huawei.com
>
上级
19481297
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
90 deletion
+43
-90
zh-cn/application-dev/reference/apis/js-apis-camera.md
zh-cn/application-dev/reference/apis/js-apis-camera.md
+43
-90
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-camera.md
浏览文件 @
aeacb36a
...
@@ -857,6 +857,7 @@ async function getCameraInfo("cameraId") {
...
@@ -857,6 +857,7 @@ async function getCameraInfo("cameraId") {
| 名称 | 默认值 | 说明 |
| 名称 | 默认值 | 说明 |
| ----------------------- | --------- | ------------ |
| ----------------------- | --------- | ------------ |
| CAMERA_FORMAT_RGBA_8888 | 3 | RGB格式的图片。 |
| CAMERA_FORMAT_YUV_420_SP| 1003 | YUV 420 SP格式的图片。 |
| CAMERA_FORMAT_YUV_420_SP| 1003 | YUV 420 SP格式的图片。 |
| CAMERA_FORMAT_JPEG | 2000 | JPEG格式的图片。 |
| CAMERA_FORMAT_JPEG | 2000 | JPEG格式的图片。 |
...
@@ -1712,7 +1713,7 @@ hasFlash(callback: AsyncCallback<boolean\>): void
...
@@ -1712,7 +1713,7 @@ hasFlash(callback: AsyncCallback<boolean\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
hasFlash
((
err
,
status
)
=>
{
ca
ptureSession
.
hasFlash
((
err
,
status
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to check whether the device has flash light.
${
err
.
message
}
`
);
console
.
error
(
`Failed to check whether the device has flash light.
${
err
.
message
}
`
);
return
;
return
;
...
@@ -1738,7 +1739,7 @@ hasFlash(): Promise<boolean\>
...
@@ -1738,7 +1739,7 @@ hasFlash(): Promise<boolean\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
hasFlash
().
then
((
status
)
=>
{
ca
ptureSession
.
hasFlash
().
then
((
status
)
=>
{
console
.
log
(
`Promise returned with the flash light support status:
${
status
}
`
);
console
.
log
(
`Promise returned with the flash light support status:
${
status
}
`
);
})
})
```
```
...
@@ -1761,7 +1762,7 @@ isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean\>): v
...
@@ -1761,7 +1762,7 @@ isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean\>): v
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isFlashModeSupported
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
,
(
err
,
status
)
=>
{
ca
ptureSession
.
isFlashModeSupported
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
,
(
err
,
status
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to check whether the flash mode is supported.
${
err
.
message
}
`
);
console
.
error
(
`Failed to check whether the flash mode is supported.
${
err
.
message
}
`
);
return
;
return
;
...
@@ -1793,7 +1794,7 @@ isFlashModeSupported(flashMode: FlashMode): Promise<boolean\>
...
@@ -1793,7 +1794,7 @@ isFlashModeSupported(flashMode: FlashMode): Promise<boolean\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isFlashModeSupported
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
).
then
((
status
)
=>
{
ca
ptureSession
.
isFlashModeSupported
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
).
then
((
status
)
=>
{
console
.
log
(
`Promise returned with flash mode support status.
${
status
}
`
);
console
.
log
(
`Promise returned with flash mode support status.
${
status
}
`
);
})
})
```
```
...
@@ -1821,7 +1822,7 @@ setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void\>): void
...
@@ -1821,7 +1822,7 @@ setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setFlashMode
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
,
(
err
)
=>
{
ca
ptureSession
.
setFlashMode
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to set the flash mode
${
err
.
message
}
`
);
console
.
error
(
`Failed to set the flash mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -1858,7 +1859,7 @@ setFlashMode(flashMode: FlashMode): Promise<void\>
...
@@ -1858,7 +1859,7 @@ setFlashMode(flashMode: FlashMode): Promise<void\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setFlashMode
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
).
then
(()
=>
{
ca
ptureSession
.
setFlashMode
(
camera
.
FlashMode
.
FLASH_MODE_AUTO
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setFlashMode.
'
);
console
.
log
(
'
Promise returned with the successful execution of setFlashMode.
'
);
})
})
```
```
...
@@ -1880,7 +1881,7 @@ getFlashMode(callback: AsyncCallback<FlashMode\>): void
...
@@ -1880,7 +1881,7 @@ getFlashMode(callback: AsyncCallback<FlashMode\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFlashMode
((
err
,
flashMode
)
=>
{
ca
ptureSession
.
getFlashMode
((
err
,
flashMode
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to get the flash mode
${
err
.
message
}
`
);
console
.
error
(
`Failed to get the flash mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -1906,7 +1907,7 @@ getFlashMode(): Promise<FlashMode\>
...
@@ -1906,7 +1907,7 @@ getFlashMode(): Promise<FlashMode\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFlashMode
().
then
((
flashMode
)
=>
{
ca
ptureSession
.
getFlashMode
().
then
((
flashMode
)
=>
{
console
.
log
(
`Promise returned with current flash mode :
${
flashMode
}
`
);
console
.
log
(
`Promise returned with current flash mode :
${
flashMode
}
`
);
})
})
```
```
...
@@ -1929,7 +1930,7 @@ isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean\>)
...
@@ -1929,7 +1930,7 @@ isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean\>)
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isExposureModeSupported
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKEN
,(
err
)
=>
{
ca
ptureSession
.
isExposureModeSupported
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKEN
,(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to check exposure mode supported
${
err
.
message
}
`
);
console
.
log
(
`Failed to check exposure mode supported
${
err
.
message
}
`
);
return
;
return
;
...
@@ -1961,7 +1962,7 @@ isExposureModeSupported(aeMode: ExposureMode): Promise<boolean\>
...
@@ -1961,7 +1962,7 @@ isExposureModeSupported(aeMode: ExposureMode): Promise<boolean\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isExposureModeSupported
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKED
).
then
((
isSupported
)
=>
{
ca
ptureSession
.
isExposureModeSupported
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKED
).
then
((
isSupported
)
=>
{
console
.
log
(
`Promise returned with exposure mode supported :
${
isSupported
}
`
);
console
.
log
(
`Promise returned with exposure mode supported :
${
isSupported
}
`
);
})
})
```
```
...
@@ -1983,7 +1984,7 @@ getExposureMode(callback: AsyncCallback<ExposureMode\>): void
...
@@ -1983,7 +1984,7 @@ getExposureMode(callback: AsyncCallback<ExposureMode\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposureMode
((
err
,
exposureMode
)
=>
{
ca
ptureSession
.
getExposureMode
((
err
,
exposureMode
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to get the exposure mode
${
err
.
message
}
`
);
console
.
log
(
`Failed to get the exposure mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2009,7 +2010,7 @@ getExposureMode(): Promise<ExposureMode\>
...
@@ -2009,7 +2010,7 @@ getExposureMode(): Promise<ExposureMode\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposureMode
().
then
((
exposureMode
)
=>
{
ca
ptureSession
.
getExposureMode
().
then
((
exposureMode
)
=>
{
console
.
log
(
`Promise returned with current exposure mode :
${
exposureMode
}
`
);
console
.
log
(
`Promise returned with current exposure mode :
${
exposureMode
}
`
);
})
})
```
```
...
@@ -2032,7 +2033,7 @@ setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void\>): void
...
@@ -2032,7 +2033,7 @@ setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setExposureMode
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKEN
,(
err
)
=>
{
ca
ptureSession
.
setExposureMode
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKEN
,(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to set the exposure mode
${
err
.
message
}
`
);
console
.
log
(
`Failed to set the exposure mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2058,7 +2059,7 @@ setExposureMode(aeMode: ExposureMode): Promise<void\>
...
@@ -2058,7 +2059,7 @@ setExposureMode(aeMode: ExposureMode): Promise<void\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setExposureMode
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKED
).
then
(()
=>
{
ca
ptureSession
.
setExposureMode
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKED
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setExposureMode.
'
);
console
.
log
(
'
Promise returned with the successful execution of setExposureMode.
'
);
})
})
```
```
...
@@ -2080,7 +2081,7 @@ getExposurePoint(callback: AsyncCallback<Point\>): void
...
@@ -2080,7 +2081,7 @@ getExposurePoint(callback: AsyncCallback<Point\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposurePoint
((
err
)
=>
{
ca
ptureSession
.
getExposurePoint
((
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to get the exposurePoint mode
${
err
.
message
}
`
);
console
.
log
(
`Failed to get the exposurePoint mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2106,7 +2107,7 @@ getExposurePoint(): Promise<Point\>
...
@@ -2106,7 +2107,7 @@ getExposurePoint(): Promise<Point\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposurePoint
().
then
(()
=>
{
ca
ptureSession
.
getExposurePoint
().
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of getExposurePoint.
'
);
console
.
log
(
'
Promise returned with the successful execution of getExposurePoint.
'
);
})
})
```
```
...
@@ -2128,7 +2129,7 @@ setExposurePoint(exposurePoint: Point, callback: AsyncCallback<void\>): void
...
@@ -2128,7 +2129,7 @@ setExposurePoint(exposurePoint: Point, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setExposurePoint
(
point
,
(
err
)
=>
{
ca
ptureSession
.
setExposurePoint
(
point
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to set the exposurePoint mode
${
err
.
message
}
`
);
console
.
log
(
`Failed to set the exposurePoint mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2154,7 +2155,7 @@ setExposurePoint(exposurePoint: Point): Promise<void\>
...
@@ -2154,7 +2155,7 @@ setExposurePoint(exposurePoint: Point): Promise<void\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setExposurePoint
(
point
).
then
(()
=>
{
ca
ptureSession
.
setExposurePoint
(
point
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setExposurePoint.
'
);
console
.
log
(
'
Promise returned with the successful execution of setExposurePoint.
'
);
})
})
```
```
...
@@ -2176,7 +2177,7 @@ getExposureBiasRange(callback: AsyncCallback<Array<number\>\>): void
...
@@ -2176,7 +2177,7 @@ getExposureBiasRange(callback: AsyncCallback<Array<number\>\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposureBiasRange
((
err
,
biasRangeArray
)
=>
{
ca
ptureSession
.
getExposureBiasRange
((
err
,
biasRangeArray
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to get the array of compenstation range
${
err
.
message
}
`
);
console
.
log
(
`Failed to get the array of compenstation range
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2202,7 +2203,7 @@ getExposureBiasRange(): Promise<Array<number\>\>
...
@@ -2202,7 +2203,7 @@ getExposureBiasRange(): Promise<Array<number\>\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isExposureModeSupported
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKED
).
then
((
isSupported
)
=>
{
ca
ptureSession
.
isExposureModeSupported
(
camera
.
ExposureMode
.
EXPOSURE_MODE_LOCKED
).
then
((
isSupported
)
=>
{
console
.
log
(
`Promise returned with exposure mode supported :
${
isSupported
}
`
);
console
.
log
(
`Promise returned with exposure mode supported :
${
isSupported
}
`
);
})
})
```
```
...
@@ -2227,7 +2228,7 @@ setExposureBias(exposureBias: number, callback: AsyncCallback<void\>): void
...
@@ -2227,7 +2228,7 @@ setExposureBias(exposureBias: number, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setExposureBias
(
-
4
,(
err
)
=>
{
ca
ptureSession
.
setExposureBias
(
-
4
,(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to set the exposure bias
${
err
.
message
}
`
);
console
.
log
(
`Failed to set the exposure bias
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2261,7 +2262,7 @@ setExposureBias(exposureBias: number): Promise<void\>
...
@@ -2261,7 +2262,7 @@ setExposureBias(exposureBias: number): Promise<void\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setExposureBias
(
-
4
).
then
(()
=>
{
ca
ptureSession
.
setExposureBias
(
-
4
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setExposureBias.
'
);
console
.
log
(
'
Promise returned with the successful execution of setExposureBias.
'
);
})
})
```
```
...
@@ -2283,7 +2284,7 @@ getExposureValue(callback: AsyncCallback<number\>): void
...
@@ -2283,7 +2284,7 @@ getExposureValue(callback: AsyncCallback<number\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposureValue
((
err
,
exposureValue
)
=>
{
ca
ptureSession
.
getExposureValue
((
err
,
exposureValue
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
`Failed to get the exposure value
${
err
.
message
}
`
);
console
.
log
(
`Failed to get the exposure value
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2309,7 +2310,7 @@ getExposureValue(): Promise<number\>
...
@@ -2309,7 +2310,7 @@ getExposureValue(): Promise<number\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getExposureValue
().
then
((
exposureValue
)
=>
{
ca
ptureSession
.
getExposureValue
().
then
((
exposureValue
)
=>
{
console
.
log
(
`Promise returned with exposure value:
${
exposureValude
}
`
);
console
.
log
(
`Promise returned with exposure value:
${
exposureValude
}
`
);
})
})
```
```
...
@@ -2332,7 +2333,7 @@ isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean\>): void
...
@@ -2332,7 +2333,7 @@ isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isFocusModeSupported
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
,
(
err
,
status
)
=>
{
ca
ptureSession
.
isFocusModeSupported
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
,
(
err
,
status
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to check whether the focus mode is supported.
${
err
.
message
}
`
);
console
.
error
(
`Failed to check whether the focus mode is supported.
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2364,7 +2365,7 @@ isFocusModeSupported(afMode: FocusMode): Promise<boolean\>
...
@@ -2364,7 +2365,7 @@ isFocusModeSupported(afMode: FocusMode): Promise<boolean\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
isFocusModeSupported
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
).
then
((
status
)
=>
{
ca
ptureSession
.
isFocusModeSupported
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
).
then
((
status
)
=>
{
console
.
log
(
`Promise returned with focus mode support status
${
status
}
.`
);
console
.
log
(
`Promise returned with focus mode support status
${
status
}
.`
);
})
})
```
```
...
@@ -2389,7 +2390,7 @@ setFocusMode(afMode: FocusMode, callback: AsyncCallback<void\>): void
...
@@ -2389,7 +2390,7 @@ setFocusMode(afMode: FocusMode, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setFocusMode
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
,
(
err
)
=>
{
ca
ptureSession
.
setFocusMode
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to set the focus mode
${
err
.
message
}
`
);
console
.
error
(
`Failed to set the focus mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2423,7 +2424,7 @@ setFocusMode(afMode: FocusMode): Promise<void\>
...
@@ -2423,7 +2424,7 @@ setFocusMode(afMode: FocusMode): Promise<void\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setFocusMode
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
).
then
(()
=>
{
ca
ptureSession
.
setFocusMode
(
camera
.
FocusMode
.
FOCUS_MODE_AUTO
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setFocusMode.
'
);
console
.
log
(
'
Promise returned with the successful execution of setFocusMode.
'
);
})
})
```
```
...
@@ -2445,7 +2446,7 @@ getFocusMode(callback: AsyncCallback<FocusMode\>): void
...
@@ -2445,7 +2446,7 @@ getFocusMode(callback: AsyncCallback<FocusMode\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFocusMode
((
err
,
afMode
)
=>
{
ca
ptureSession
.
getFocusMode
((
err
,
afMode
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to get the focus mode
${
err
.
message
}
`
);
console
.
error
(
`Failed to get the focus mode
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2471,7 +2472,7 @@ getFocusMode(): Promise<FocusMode\>
...
@@ -2471,7 +2472,7 @@ getFocusMode(): Promise<FocusMode\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFocusMode
().
then
((
afMode
)
=>
{
ca
ptureSession
.
getFocusMode
().
then
((
afMode
)
=>
{
console
.
log
(
`Promise returned with current focus mode :
${
afMode
}
`
);
console
.
log
(
`Promise returned with current focus mode :
${
afMode
}
`
);
})
})
```
```
...
@@ -2496,7 +2497,7 @@ setFocusPoint(point: Point, callback: AsyncCallback<void\>): void
...
@@ -2496,7 +2497,7 @@ setFocusPoint(point: Point, callback: AsyncCallback<void\>): void
```
js
```
js
const
Point1
=
{
x
:
1
,
y
:
1
};
const
Point1
=
{
x
:
1
,
y
:
1
};
ca
meraInput
.
setFocusPoint
(
Point1
,
(
err
)
=>
{
ca
ptureSession
.
setFocusPoint
(
Point1
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to set the focus point
${
err
.
message
}
`
);
console
.
error
(
`Failed to set the focus point
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2530,7 +2531,7 @@ setFocusPoint(point: Point): Promise<void\>
...
@@ -2530,7 +2531,7 @@ setFocusPoint(point: Point): Promise<void\>
```
js
```
js
const
Point2
=
{
x
:
2
,
y
:
2
};
const
Point2
=
{
x
:
2
,
y
:
2
};
ca
meraInput
.
setFocusPoint
(
Point2
).
then
(()
=>
{
ca
ptureSession
.
setFocusPoint
(
Point2
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setFocusPoint.
'
);
console
.
log
(
'
Promise returned with the successful execution of setFocusPoint.
'
);
})
})
```
```
...
@@ -2552,7 +2553,7 @@ getFocusPoint(callback: AsyncCallback<Point\>): void
...
@@ -2552,7 +2553,7 @@ getFocusPoint(callback: AsyncCallback<Point\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFocusPoint
((
err
,
point
)
=>
{
ca
ptureSession
.
getFocusPoint
((
err
,
point
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to get the current focus point
${
err
.
message
}
`
);
console
.
error
(
`Failed to get the current focus point
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2578,7 +2579,7 @@ getFocusPoint(): Promise<Point\>
...
@@ -2578,7 +2579,7 @@ getFocusPoint(): Promise<Point\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFocusPoint
().
then
((
point
)
=>
{
ca
ptureSession
.
getFocusPoint
().
then
((
point
)
=>
{
console
.
log
(
'
Promise returned with the current focus point:
'
+
JSON
.
stringify
(
point
));
console
.
log
(
'
Promise returned with the current focus point:
'
+
JSON
.
stringify
(
point
));
})
})
```
```
...
@@ -2600,7 +2601,7 @@ getFocalLength(callback: AsyncCallback<number\>): void
...
@@ -2600,7 +2601,7 @@ getFocalLength(callback: AsyncCallback<number\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFocalLength
((
err
,
focalLength
)
=>
{
ca
ptureSession
.
getFocalLength
((
err
,
focalLength
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to get the current focal length
${
err
.
message
}
`
);
console
.
error
(
`Failed to get the current focal length
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2626,7 +2627,7 @@ getFocalLength(): Promise<number\>
...
@@ -2626,7 +2627,7 @@ getFocalLength(): Promise<number\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getFocalLength
().
then
((
focalLength
)
=>
{
ca
ptureSession
.
getFocalLength
().
then
((
focalLength
)
=>
{
console
.
log
(
`Promise returned with the current focal length:
${
focalLength
}
`
);
console
.
log
(
`Promise returned with the current focal length:
${
focalLength
}
`
);
})
})
```
```
...
@@ -2648,7 +2649,7 @@ getZoomRatioRange\(callback: AsyncCallback<Array<number\>\>\): void
...
@@ -2648,7 +2649,7 @@ getZoomRatioRange\(callback: AsyncCallback<Array<number\>\>\): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getZoomRatioRange
((
err
,
zoomRatioRange
)
=>
{
ca
ptureSession
.
getZoomRatioRange
((
err
,
zoomRatioRange
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to get the zoom ratio range.
${
err
.
message
}
`
);
console
.
error
(
`Failed to get the zoom ratio range.
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2674,7 +2675,7 @@ getZoomRatioRange\(\): Promise<Array<number\>\>
...
@@ -2674,7 +2675,7 @@ getZoomRatioRange\(\): Promise<Array<number\>\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getZoomRatioRange
().
then
((
zoomRatioRange
)
=>
{
ca
ptureSession
.
getZoomRatioRange
().
then
((
zoomRatioRange
)
=>
{
console
.
log
(
`Promise returned with zoom ratio range:
${
zoomRatioRange
.
length
}
`
);
console
.
log
(
`Promise returned with zoom ratio range:
${
zoomRatioRange
.
length
}
`
);
})
})
```
```
...
@@ -2697,7 +2698,7 @@ setZoomRatio(zoomRatio: number, callback: AsyncCallback<void\>): void
...
@@ -2697,7 +2698,7 @@ setZoomRatio(zoomRatio: number, callback: AsyncCallback<void\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setZoomRatio
(
1
,
(
err
)
=>
{
ca
ptureSession
.
setZoomRatio
(
1
,
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to set the zoom ratio value
${
err
.
message
}
`
);
console
.
error
(
`Failed to set the zoom ratio value
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2729,7 +2730,7 @@ setZoomRatio(zoomRatio: number): Promise<void\>
...
@@ -2729,7 +2730,7 @@ setZoomRatio(zoomRatio: number): Promise<void\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
setZoomRatio
(
1
).
then
(()
=>
{
ca
ptureSession
.
setZoomRatio
(
1
).
then
(()
=>
{
console
.
log
(
'
Promise returned with the successful execution of setZoomRatio.
'
);
console
.
log
(
'
Promise returned with the successful execution of setZoomRatio.
'
);
})
})
```
```
...
@@ -2751,7 +2752,7 @@ getZoomRatio(callback: AsyncCallback<number\>): void
...
@@ -2751,7 +2752,7 @@ getZoomRatio(callback: AsyncCallback<number\>): void
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getZoomRatio
((
err
,
zoomRatio
)
=>
{
ca
ptureSession
.
getZoomRatio
((
err
,
zoomRatio
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to get the zoom ratio
${
err
.
message
}
`
);
console
.
error
(
`Failed to get the zoom ratio
${
err
.
message
}
`
);
return
;
return
;
...
@@ -2777,7 +2778,7 @@ getZoomRatio(): Promise<number\>
...
@@ -2777,7 +2778,7 @@ getZoomRatio(): Promise<number\>
**示例:**
**示例:**
```
js
```
js
ca
meraInput
.
getZoomRatio
().
then
((
zoomRatio
)
=>
{
ca
ptureSession
.
getZoomRatio
().
then
((
zoomRatio
)
=>
{
console
.
log
(
`Promise returned with current zoom ratio :
${
zoomRatio
}
`
);
console
.
log
(
`Promise returned with current zoom ratio :
${
zoomRatio
}
`
);
})
})
```
```
...
@@ -3375,54 +3376,6 @@ previewOutput.on('error', (previewOutputError) => {
...
@@ -3375,54 +3376,6 @@ previewOutput.on('error', (previewOutputError) => {
拍照会话中使用的输出信息。
拍照会话中使用的输出信息。
### getDefaultCaptureSetting
getDefaultCaptureSetting(callback: AsyncCallback<PhotoCaptureSetting
\>
): void
获取默认拍照参数,通过注册回调函数获取结果。
**系统能力:**
SystemCapability.Multimedia.Camera.Core
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------------------------------- | ---- | -------------------- |
| callback | AsyncCallback<
[
PhotoCaptureSetting
](
#photocapturesetting
)
\>
| 是 | 回调函数,用于获取结果。 |
**示例:**
```
js
photoOutput
.
getDefaultCaptureSetting
((
err
,
photocapturesetting
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to get the defaultCaptureSetting.
${
err
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned with an array of defaultCaptureSetting.
'
);
})
```
### getDefaultCaptureSetting
getDefaultCaptureSetting(): Promise<PhotoCaptureSetting
\>
获取默认拍照参数,通过Promise获取结果。
**系统能力:**
SystemCapability.Multimedia.Camera.Core
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------- | ----------------------- |
| Promise<
[
PhotoCaptureSetting
](
#photocapturesetting
)
\>
| 使用Promise的方式获取结果。 |
**示例:**
```
js
photoOutput
.
getDefaultCaptureSetting
().
then
((
photocapturesetting
)
=>
{
console
.
log
(
'
Callback returned with an array of defaultCaptureSetting.
'
);
})
```
### capture
### capture
capture(callback: AsyncCallback<void
\>
): void
capture(callback: AsyncCallback<void
\>
): void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录