1.创建一个组件,绘制海报并显示。
2.设定海报背景存在问题,升级的api怎么写?demo也是写的够水的。
结果来了一句
我就很烦了,new Image不能用。
绘制海报为什么不行了?Why can't drawing posters work?
绘制海报为什么不行了?1.创建一个组件,绘制海报并显示。
2.设定海报背景存在问题,升级的api怎么写?demo也是写的够水的。
结果来了一句
我就很烦了,new Image不能用。
1. Create a component, draw a poster and display it. 2. There is a problem with setting the background of the poster. How to write the upgraded API? The demo is also written with enough water. As a result, I was very annoyed. New image can't be used.
回答:
新版绘制海报写入背景图片,以上代码可行,其他的基本上都小问题。在此帮助大家填坑。有希望让写文档的官网好好反思一下,一个案例都不给。给的还是一个半成品的。做个人吧。每年都要骂你们,你们不要脸我要素质。
新版的用Canvas.createImage(),等价于new Image
方便出代码片段嘛,我来这边调调看
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html
原文出处:绘制海报为什么不行了?
https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.createImage.html