未验证 提交 3070875e 编写于 作者: O openharmony_ci 提交者: Gitee

!7304 image文档示例优化-二期

Merge pull request !7304 from 徐蕊w/master
...@@ -892,8 +892,6 @@ let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } ...@@ -892,8 +892,6 @@ let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts, (pixelmap) => { image.createPixelMap(color, opts, (pixelmap) => {
pixelmap.release().then(() => { pixelmap.release().then(() => {
console.log('Succeeded in releasing pixelmap object.'); console.log('Succeeded in releasing pixelmap object.');
}).catch(error => {
console.log('Failed to release pixelmap object.');
}) })
}) })
``` ```
...@@ -1637,8 +1635,6 @@ let packOpts = { format:"image/jpeg", quality:98 } ...@@ -1637,8 +1635,6 @@ let packOpts = { format:"image/jpeg", quality:98 }
const pixelMapApi = new ArrayBuffer(400); const pixelMapApi = new ArrayBuffer(400);
imagePackerApi.packing(pixelMapApi, packOpts, data => { imagePackerApi.packing(pixelMapApi, packOpts, data => {
console.log('Succeeded in packing the image.'); console.log('Succeeded in packing the image.');
}).catch(error => {
console.log('Failed to pack the image.');
}) })
``` ```
...@@ -2070,8 +2066,6 @@ release(callback: AsyncCallback\<void>): void ...@@ -2070,8 +2066,6 @@ release(callback: AsyncCallback\<void>): void
```js ```js
img.release(() =>{ img.release(() =>{
console.log('release succeeded.'); console.log('release succeeded.');
}).catch(error => {
console.log('release failed.');
}) })
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册