我从 codeproject 下载了一些名为 signaturecanvas 的代码,它使用 HTML5 控件画布生成签名控件。它工作得很好。但我被困在这部分。我不知道如何将 signaturebytearray 保存为 jpeg 图像,以便之后显示?
链接到 javascript 源: http: //www.codeproject.com/Articles/432675/Building-a-Signature-Control-Using-Canvas
默认.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="signature.css" rel="scripts/stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/signature.js"></script>
<script type="text/javascript">
function loaded() {
var signature = new ns.SignatureControl({
containerId: 'container', callback: function () {
var signatureByteArray = signature.getSignatureImage();
}
});
signature.init();
}
window.addEventListener('DOMContentLoaded', loaded, false);
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="container">
</div>
</form>
</body>
</html>