提交 b85276f9 编写于 作者: M mali

Document sample modification

Signed-off-by: Nmali <mali81@huawei.com>
上级 35e04d3f
...@@ -194,13 +194,15 @@ getSupportedOutputCapability(camera:CameraDevice, callback: AsyncCallback<Camera ...@@ -194,13 +194,15 @@ getSupportedOutputCapability(camera:CameraDevice, callback: AsyncCallback<Camera
**示例:** **示例:**
```js ```js
let cameraDevice = cameras[0]; cameraManager.getSupportedCameras().then((cameras) => {
cameraManager.getSupportedOutputCapability(cameraDevice, (err, CameraOutputCapability) => { let cameraDevice = cameras[0];
if (err) { cameraManager.getSupportedOutputCapability(cameraDevice, (err, CameraOutputCapability) => {
console.error(`Failed to get the outputCapability. ${err.message}`); if (err) {
return; console.error(`Failed to get the outputCapability. ${err.message}`);
} return;
console.log('Callback returned with an array of supported outputCapability'); }
console.log('Callback returned with an array of supported outputCapability');
})
}) })
``` ```
...@@ -227,9 +229,11 @@ getSupportedOutputCapability(camera:CameraDevice): Promise<CameraOutputCapabilit ...@@ -227,9 +229,11 @@ getSupportedOutputCapability(camera:CameraDevice): Promise<CameraOutputCapabilit
**示例:** **示例:**
```js ```js
let cameraDevice = cameras[0]; cameraManager.getSupportedCameras().then((cameras) => {
cameraManager.getSupportedOutputCapability(cameraDevice).then((cameraoutputcapability) => { let cameraDevice = cameras[0];
console.log('Promise returned with an array of supported outputCapability'); cameraManager.getSupportedOutputCapability(cameraDevice).then((cameraoutputcapability) => {
console.log('Promise returned with an array of supported outputCapability');
})
}) })
``` ```
...@@ -3254,9 +3258,16 @@ capture(setting: PhotoCaptureSetting, callback: AsyncCallback<void\>): void ...@@ -3254,9 +3258,16 @@ capture(setting: PhotoCaptureSetting, callback: AsyncCallback<void\>): void
**示例:** **示例:**
```js ```js
let settings:PhotoCaptureSetting = { let captureLocation = {
quality = 1, latitude: 0,
rotation = 0 longitude: 0,
altitude: 0,
}
let settings = {
quality: camera.QualityLevel.QUALITY_LEVEL_LOW,
rotation: camera.ImageRotation.ROTATION_0,
location: captureLocation,
mirror: false
} }
photoOutput.capture(settings, (err) => { photoOutput.capture(settings, (err) => {
if (err) { if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册