//保存图片
pawjms(){
var that = this;
wx.canvasToTempFilePath({
x: 0,
y: 0,
canvasId: '画布id',
fileType: 'jpg',//格式
quality: 1,
success: function (res) {
that.setData({//生成的图片
shareImage: res.tempFilePath
})
setTimeout(function(){
wx.showModal({
title: '提示',
content: '将生成的海报保存到手机相册,可以发送给微信好友或分享到朋友圈',
success(res) {
if (res.confirm) {
that.eventSave()
} else if (res.cancel) {
wx.showToast({
title: '已取消',
icon: 'success',
wx小程序画布保存成图片
最新推荐文章于 2023-08-16 09:18:33 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)