saveImage() {
var that = this
const [data, w, h] = screenshot(renderer, scene, camera, WebGLRenderTarget);
const ctx = helperCanvas.getContext('2d')
const imgData = helperCanvas.createImageData(data, w, h);
helperCanvas.height = imgData.height;
helperCanvas.width = imgData.width;
ctx.putImageData(imgData, 0, 0);
const imgDataFromCanvas = ctx.getImageData(0, 0, w, h)
const hasPixel = imgDataFromCanvas.data.some(i => i !== 0)
wx.canvasToTempFilePath({
canvas: helperCanvas,
success(res) {
const local_path = res.tempFilePath
const url = that.goto_uploadfile(local_path);
that.useing_show.image_url = url;
that.add_try_log();
},
fail(err) {
console.log("错误", err);
}
})
},
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。