0

是否可以直接截取用户看到的网站可见部分的屏幕截图(由浏览器呈现),包括用户所做的任何更改(例如移动的 div、在表单中键入的文本等)?


因此,您打开一个网站,您可以在其中更改其内容。还有一个按钮(当然在网站上),当您单击它时,网站的实际可见部分以及您所做的所有更改都会保存为图像,例如会出现一个弹出窗口,您可以在其中输入电子邮件将此图像发送到,或类似的东西。Javascript、php、html5 还是其他?旧浏览器和 ie 无关紧要。我已经搜索了很多答案,阅读了很多相关文章,但我找不到解决方案,因为我需要的不是像 html2canvas 那样重新渲染页面的脚本,而是捕获显示的实际内容屏幕。任何想法和意见都非常感谢!

4

1 回答 1

0

This is something that can be extremely tricky.

Essentially your only option of doing this in browser with no extensions or such is to try rendering HTML into the <canvas> tag.

There are several projects which do that, most reliable choices are noted in this SO question's answers: Render HTML in Canvas/WebGL

Note that none of the projects are 100% accurate, but a canvas can be rendered into an image and thus could be saved or emailed by the user like you asked.

于 2012-11-28T08:03:26.363 回答