提交 8f0023b6 编写于 作者: Z zhang-xiaobo1997

add imageReceiver use

Signed-off-by: Nzhang-xiaobo1997 <tony.zhangxiaobo@huawei.com>
上级 956eef68
...@@ -271,3 +271,23 @@ imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data )=> {}) ...@@ -271,3 +271,23 @@ imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data )=> {})
``` ```
### ImageReceivert的使用
```js
//创建ImageReceiver
var receiver = image.createImageReceiver(8 * 1024, 8, image.ImageFormat.JPEG, 1);
//获取Surface ID
var surfaceId = await receiver.getReceivingSurfaceId();
receiver.on('imageArrival', () => {
//去获取Surface中的buffer的方法
receiver.readNextImage((err, img) => {
img.getComponent(4, (err, componet) => {
//操作componet.byteBuffer
})
})
})
//调用方法将surfaceId传递给消费端。
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册