this is my code
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="html2canvas.js"></script>
<script type="text/javascript">
$(function() {
$("#btn").click(function() {
html2canvas($("#img_load"), {
onrendered: function(canvas) {
theCanvas = canvas;
document.body.appendChild(canvas);
Canvas2Image.saveAsPNG(canvas);
$("#img_preview").append(canvas);
}
});
});
});
</script>
</head>
<body>
<div id="img_load">
<img id="test" src="http://www.keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" style="width: 200px; height: 200px;"/>
</div>
<button id="btn" type="button">OK</button>
<div id="img_preview" style="border: 1px solid black; width: 200px; height: 200px;">
<canvas id="myCanvas" width="200" height="100"></canvas>
</div>
</body>
when I press the "OK" I want to send that image to my "img_preview" div. but it create new cavas instead going to that div. plz help me to fix that..