Mini Program uses canvas to generate pictures

use canvas to generate pictures in Mini Program. There are layouts such as text in the pictures, which are similar to the QR code pictures in Alipay. Does Mini Program have a similar library?

Mar.12,2021

has carried out a similar project. At present, after the dom operation (poster making), write it to canvas, and finally generate an image


do you want to achieve the screenshot function in Mini Program?


text you can wrap the text according to the width of the device and the measureText of the canvas.
at the same time, you can calculate the dynamic height of the text
let ctx = wx.createCanvasContext ("myCanvas")
draw text
draw ctx.drawImage
draw () draw
wx.canvasToTempFilePath generate picture address
wx.previewImage preview picture with scan function

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c54a-2bb50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c54a-2bb50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?