29
rated 0 times
[
35]
[
6]
/ answers: 1 / hits: 5378
/ 10 Years ago, sun, february 16, 2014, 12:00:00
HTML:
<div id='mydiv' name='mydiv' width='600' height='600' >
<img src=clouds.png></div>
$(document).ready(function ()
{
//alert(save pleaseeeee?);
$(#save).click(function ()
{
html2canvas([document.getElementById('mydiv')],
{
onrendered: function (canvas)
{
var canvas = document.getElementById('canvas');
$.post(save.php,
{
data: canvas.toDataURL(image/jpeg)
},
function (file)
{
window.location.href = download.php?path=+ file
});
})
});
// end of onclick save
});
The autosave works when converting a canvas to image only. I tried to merge it with the html2canvas function so that I can save div-canvas-image. Thanks!
More From » image