0

I found this code on aspsnippets.com. I ran it successfully as far as running web page and being able to draw a signature and then it saves it to another html image on the screen. But I want to get this image into my database. How can I call html from my .aspx.vb page?

<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>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
PurpleRugz
  • 117
  • 1
  • 4
  • 13
  • here is where i got the code from: http://www.aspsnippets.com/demos/1434/ – PurpleRugz Sep 12 '16 at 00:03
  • You want to store this exact code in a DB? – S3S Sep 12 '16 at 02:39
  • I want to record someone's signature and save the image of that signature in my sql database. – PurpleRugz Sep 12 '16 at 13:05
  • I'd ask the source of the code... and i'd really, really caution you in running code that you find on the net which you don't fully understand. Here is the sql server specifics you need to be aware of. http://stackoverflow.com/questions/5613898/storing-images-in-sql-server – S3S Sep 12 '16 at 13:18

0 Answers0