Use HTML5 Canvas to capture part of a web page?

前端 未结 4 1678
别跟我提以往
别跟我提以往 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 10:54

    You can "emulate" the screen view by reading the DOM and creating a canvas image with javascript from it. Have a look at http://hertzen.com/experiments/jsfeedback/ and the underlying html2canvas script to get an idea how you can do it with purely Javascript (no plugins or server interaction necessary).

提交回复
热议问题