老师,发现里的分享能讲解一下生成海报保存到本地吗?这个需求在公司里很常见的
来源:1-1 课程导学
纸飞机上的梦丶
2019-08-23
老师,发现里的分享能讲解一下生成海报保存到本地吗?这个需求在公司里很常见的
写回答
1回答
-
课程中讲的是如何分享选中数据的卡片给好友。
如果想分享海报的话,步骤:
1、在小程序中使用canvas来绘制海报:https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createCanvasContext.html
2、使用wx.canvasToTempFilePath()把canvas画布转成图片并返回图片地址:https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasToTempFilePath.html
3、使用wx.saveImageToPhotosAlbum()保存图片到用户手机:https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.saveImageToPhotosAlbum.html
012019-08-23
相似问题