使用xcomponent组件 nativewindow通过opencv预览摄像头视频 ,全屏后慢慢白屏 解决办法 。
·
直接上代码 。
XComponent({
id: 'xcomponent',
type: XComponentType.TEXTURE,//原来为SURFACE
controller: this.xComponentController,
libraryname: 'entry'
})
.onLoad(() => {
// this.xComponentController.setXComponentSurfaceSize({ surfaceWidth:480 , surfaceHeight: 640 })
// this.surfaceId = this.xComponentController.getXComponentSurfaceId()
// console.info('onLoad over ')
})
.width('100%')
.height('100%')
.backgroundColor("#000000")//必须为黑色。
更多推荐
所有评论(0)