开发者工具和安卓都可以使用,ios最新版微信就是不行
canvas:function(){
var that = this
var context = wx.createCanvasContext(‘ass’)
context.drawImage(that.data.downphoto_x, 0, 0, that.data.width, 390)
context.stroke()
context.drawImage(that.data.downimage, 20, 270, 80, 80)
context.stroke()
context.drawImage(’/images/saoma.jpg’, 120, 300, 100, 30)
context.draw()
},
maskss:function(){
var that=this
that.setData({
fenxiao: true
})
},
baocun:function(){
var that=this
wx.canvasToTempFilePath({
canvasId: ‘ass’,
success: function success(res) {
console.log(res)
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function success(res) {
wx.showToast({
title: ‘保存成功’,
duration: 1500,
})
},
complete: function fail(e) {
console.log(e.errMsg);
}
});
},
complete: function complete(e) {
console.log(e.errMsg);
}
});
}