0
Ich muss die Maske entfernen, bevor sie gespeichert wurde. Wie transparente Maske?Wie transparente Maske in FabricJS?
Hier ist die Speicherfunktion.
$(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; // Set to original scale
window.open(canvas.toDataURL({
format: 'png',
multiplier: multi,
left: (canvas.width - maskWidth)/2,
height: maskOriHeight/multi,
width: maskOriWidth/multi
}));
}
});