search

Home  >  Q&A  >  body text

html5 - canvas在手机浏览器上无法保存成图片

在canvas画了图片,用了toDataURL(),在电脑上可以成功保存,但是在手机浏览器上(欧朋浏览器、微信浏览器)无法保存成功,显示为下载失败,这是怎么回事?是手机的限制吗?还是需要一些设置。

PHP中文网PHP中文网2871 days ago938

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 11:26:26

    Mainly due to the performance problem of mobile browsers. Small pictures of more than ten K are no problem, but if they are large, they will get stuck easily

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 11:26:26

    Encountering the same problem, the current thing I can think of is to upload it to the server first, and then return a server-side image url address

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 11:26:26

    I used to make a canvas to cut pictures. I saved the pictures generated by canvas through js. Because of the cross-domain problem of js, the pictures cannot be obtained, so they still have to be saved on the server.

    reply
    0
  • Cancelreply