ImageMapster
ImageMapster copied to clipboard
Export image
Hi, I use versione 1.2.10. Having the need to export the image with the areas to db, I created this implementation which I share with you as an idea to use in the current version (if not already done)
this is the implementation me.toDataUrl = function () { return (new m.Method(this, function () { var canvas = this.graphics.createVisibleCanvas(this); var context = canvas.getContext('2d'); context.drawImage(this.image, 0, 0); context.drawImage(this.base_canvas, 0, 0); return canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); }, null, { name: 'toDataUrl' } )).go(); };
Hope can be useful