wx.canvasToTempFilePath({
            x: 0,
            y: 0,
            width: 200,
            height: 200,
//复制 * 750 / wx.getSystemInfoSync().windowWidth,换算成rpx;
            destWidth: 500 * 750 / wx.getSystemInfoSync().windowWidth,
            destHeight: 500 * 750 / wx.getSystemInfoSync().windowHeight,
            canvasId: 'artQr',
            success(res) {
                console.log(res.tempFilePath)
                that.setData({
                    qrImg: res.tempFilePath
                })
            }
        })

 

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐