小程序canvas2D在IOS环境下无法绘制图片,安卓无问题?
, wx.downloadFile({
url: 'https://qqadapt.qpic.cn/adapt/0/7363d9b4-a4d0-46e1-a42a-5fc8b5f24a5f/400?pt=0&ek=1&kp=1&sce=60-2-2',
success (res) {
var success_url = res.tempFilePath
})
var o = success_url1
const fileManager = wx.getFileSystemManager();
let base64 = 'data:image/jpg;base64,' +fileManager.readFileSync(o,'base64')
query.select('#myCanvas')
.fields({
node: true,
size: true
}).exec((res) => {
console.log(res)
const canvas = res[0].node
const ctx = canvas.getContext('2d')
const dpr = wx.getSystemInfoSync().windowWidth / 375
canvas.width = res[0].width * dpr
canvas.height = res[0].height * dpr
ctx.scale(dpr, dpr)
that.roundRectc(canvas, ctx, 0, 0, 262.5 * dpr, 430 * dpr, 15 * dpr, '#transparent', dpr, base64) //大图
}) 我用过base64转码, downloadFile域名也添加了,就是没图片。。QAQ