search

Home  >  Q&A  >  body text

javascript - How to grab images generated by canvas

I need to synthesize images. I wonder if I can directly grab the image generated by canvas in the background and then return it to the front end?

伊谢尔伦伊谢尔伦2731 days ago540

reply all(1)I'll reply

  • 黄舟

    黄舟2017-06-05 11:11:30

    The image front-end of canvas can be grabbed by calling the toDataURL() method.
    The specific usage can be found at https://developer.mozilla.org...

    To download, use the download attribute added in the a tag in HTML or download through the backend. For details, you can also refer to the canvas image download

    reply
    0
  • Cancelreply