0

我试图从外部网站捕获屏幕截图,然后调整其大小以在我的页面中插入结果。我使用 html2canvas 但我不明白如何制作外部页面的屏幕截图然后调整它的大小。我试过这样:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/html2canvas.js"></script>
<script>
function appcanvas() {
html2canvas("http://www.yahoo.com", {
    onrendered: function(canvas) {
    document.body.appendChild(canvas);
}
});
      }
    </script>
  <title></title>
</head>

<body>
<p>&nbsp;</p>
<input type="submit" name="button" id="button" value="Invia" onclick="appcanvas();" />
<p>&nbsp;</p>
</body>
</html>

但它不起作用有人对我有什么建议吗?

提前致谢

4

0 回答 0