Wechat H5 page rendered with canvas images can not get base64 data?

Wechat H5 develops , and renders pictures on cdn with canvas . The cross-domain problem has been solved, but the data from canvas > to base64 is still not available on the real machine. (simulator and browser are fine)

has any god ever encountered this kind of problem? ask for a solution


because the image is loaded asynchronously, you need to make sure that your image has been loaded and then rendered to canvas, you can try img.onload this method. (if canvas wants to render multiple pictures, it is recommended that you consider the counter implementation. Use the toDataUrl method when the count reaches a certain point. The personal test is valid, hee hee)


some colleagues seem to have encountered a similar problem before, and the solution is to remove data:image/png;base64.

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-1bd5f9c-3031b.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-1bd5f9c-3031b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?