获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
可以尝试的再次获取canvas实例,重新设置宽高,可以达到清空画布的效果 const query = wx.createSelectorQuery() query.select('#download') .fields({ node: true, size: true }) .exec(async (result) => { const canvas = result[0].node const ctx = canvas.getContext('2d') const windowW = wx.getSystemInfoSync().windowWidth; const ratio = windowW / 750 * 2; canvas.width = result[0].width * ratio; canvas.height = result[0].height * ratio; ctx.scale(ratio, ratio); })
canvas2D 如何清空画布?对于type=2D这种应该如何清空画布
2022-05-11