我在aspsnippets.com上找到了这段代码。我成功运行它,直到运行网页,并能够绘制签名,然后将其保存到屏幕上的另一个html图像。但是我想把这个图像放到我的数据库中。如何从我的.aspx.vb页面调用html?
<div class="tools">
<a href="#colors_sketch" data-tool="marker">Marker</a> <a href="#colors_sketch" data-tool="eraser">
Eraser</a>
</div>
<br />
<canvas id="colors_sketch" width="500" height="200" style = "border:3px solid #ccc">
</canvas>
<br />
<br />
<input type="button" id="btnSave" value="Save as Image"/>
<hr />
<img id = "imgCapture" alt = "" style = "display:table-cell;border:1px solid #ccc" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://intridea.github.io/sketch.js/lib/sketch.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#colors_sketch').sketch();
$(".tools a").eq(0).attr("style", "color:#000");
$(".tools a").click(function () {
$(".tools a").removeAttr("style");
$(this).attr("style", "color:#000");
});
$("#btnSave").bind("click", function () {
var base64 = $('#colors_sketch')[0].toDataURL();
$("#imgCapture").attr("src", base64);
$("#imgCapture").show();
});
});
</script>