How to download a image that's on HTML5 canvas?

后端 未结 2 571
时光说笑
时光说笑 2021-01-22 13:01

I wrote this webRTC app which takes photos with different filters added onto it. When I click on the click button, the frame from the webRTC video feed is loaded onto the canvas

2条回答
  •  长情又很酷
    2021-01-22 13:32

    You might also consider using Concrete.js, which is a lightweight HTML5 Canvas Framework that does peripheral stuff like this, including downloads. You would just do:

    canvas.download({
      fileName: 'my-file.png'
    });
    

提交回复
热议问题