ImageMapster icon indicating copy to clipboard operation
ImageMapster copied to clipboard

Export image

Open WhoAndWhy opened this issue 1 year ago • 0 comments

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

WhoAndWhy avatar Feb 12 '24 17:02 WhoAndWhy