3

After rendering the canvas the toDataURL returning image with canvas scale(My canvas scale is 700 x 600). How to return image with my Original Height and Width. Not canvas Width and Height. Here is the code section.

$(document).on('click','#btn-save-canvas', function(event) {
if (!fabric.Canvas.supports('toDataURL')) {
  alert('This browser doesn\'t provide means to serialize canvas to an image');
}
else {
    canvas.overlayImage.filters = [];
    canvas.overlayImage.applyFilters();
    canvas.renderAll();
    var multi = maskOriWidth/maskWidth;
    console.log(multi);
    window.open(canvas.toDataURL({
      format: 'png',
      multiplier: 0,
    }));
}
});
isuru
  • 3,385
  • 4
  • 27
  • 62

0 Answers0