canvas引用图片问题,很紧急,谢谢
canvas绘图时可以引用链接形式的图片吗,我把本地路径改成服务器的图片路径不生效了,代码如下:
ctx.drawImage('https://winhc.oss-cn-shanghai.aliyuncs.com/xcx/logo.png', 25, 20, 26, 26);
|
4 回复
wx.getImageInfo({
src: ‘https://winhc.oss-cn-shanghai.aliyuncs.com/xcx/logo.png’,
success: function (res){
console.log(res.path)
ctx.drawImage(res.path, 0, 0, 375, 300)
ctx.draw()
}
})