【发布时间】:2016-04-21 16:40:25
【问题描述】:
我曾多次尝试使用 Html2Canvas 将 iframe 捕获到屏幕截图中。但没有来,除了 iFrame 一切都来了。
我有一个带有引导菜单和简单 iframe 的网页。我想在按钮点击时全屏显示。
请问我在代码实现中缺少什么步骤。
<input type="button" id="btnCapture" value="Capture" />
<script>
$("#btnCapture").on("click", function () {
captureAndUpload();
});
function captureAndUpload() {
html2canvas(document.body, {
onrendered: function (canvas) {
$.ajax({
url: "@Html.Raw(Url.Action("Action", "Controller"))",
data: { 'capturedShot': canvas.toDataURL("image/png") },
type: "POST",
dataType: "json",
success: function (result) {
alert("ScreenCaptured");
},
error: function () {
alert("fail");
}
});
}
});
}
<script>
你的回答会很明显。
【问题讨论】:
标签: jquery asp.net-mvc iframe screenshot html2canvas