提交 55a986a4 编写于 作者: X xu-rui-w

modify the sample code of readPixels

Signed-off-by: Nxu-rui-w <xurui101@huawei.com>
上级 7563a68f
...@@ -169,7 +169,12 @@ readPixels(area: PositionArea): Promise\<void> ...@@ -169,7 +169,12 @@ readPixels(area: PositionArea): Promise\<void>
**示例:** **示例:**
```js ```js
const area = new ArrayBuffer(400); const area = {
pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
pixelmap.readPixels(area).then(() => { pixelmap.readPixels(area).then(() => {
console.log('Succeeded in reading the image data in the area.'); //符合条件则进入 console.log('Succeeded in reading the image data in the area.'); //符合条件则进入
}).catch(error => { }).catch(error => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册