Use HTML5 Canvas to capture part of a web page?

前端 未结 4 1676
别跟我提以往
别跟我提以往 2021-02-04 10:44

I know that you can capture images from an HTML5 video stream using canvas and display them on the page. What I am interested in is can you use the canvas object to create an ov

4条回答
  •  一整个雨季
    2021-02-04 11:13

    There is a possibility to embed your HTML in a SVG image and render that SVG into canvas. There are limitations as to what the HTML can contain (e.g. no JavaScript and no external resources so images must be encoded in data URLs). Keeping that in mind, it may do your job.

    This technique is documented and demoed on MDN.

提交回复
热议问题