xr-camera像普通camera一样可以把每帧的图像暴露出来
this.cameraContext = wx.createCameraContext()
const listener = this.cameraContext.onCameraFrame((frame) => {
const frameData = new Uint8Array(frame.data);
const clampedData = new Uint8ClampedArray(frameData);
const imageData = this.canvas.createImageData(clampedData, frame.width, frame.height);
........
});
listener.start();
噢,看文档不仔细,截取画布就好了https://developers.weixin.qq.com/miniprogram/dev/component/xr-frame/share/#%E6%88%AA%E5%8F%96%E7%94%BB%E5%B8%83