html2canvas(document.getElementById('divId'), {
onrendered: function(canvas) {
var extra_canvas = document.createElement('canvas');
extra_canvas.setAttribute('width', 70);
extra_canvas.setAttribute('height', 70);
var ctx = extra_canvas.getContext('2d');
ctx.drawImage(canvas, 0, 0, canvas.width, canvas.height, 0, 0, 70, 70);
var dataURL = extra_canvas.toDataURL();
var img = $(document.createElement('img'));
img.setAttribute('src', dataURL);
document.body.appendChild(img);
});
o my god you save my day.brilliant
ОтветитьУдалить