收藏
回答

安卓canvas没有响应?

代码和机器型号如下,ide和iOS还有小米8都正常

const ctx = (wx as any).createCanvasContext('canvas');
ctx.drawImage(image.path, 0, 0, canvasWidth, canvasHeight);
const comporessedResult: any = await new Promise((resolve, reject) => {
    ctx.draw(
        false,
        setTimeout(() => {
            const ret = (wx as any).canvasToTempFilePath({
                canvasId: 'canvas',
                destWidth: canvasWidth,
                destHeight: canvasHeight,
                quality: 0.4,
                fileType: 'jpg',
                success: resolve,
                failed: reject
            });
        }, 100)
    );
});
console.log('>>>>>> compress end >>>>>>>>');


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签