glfx.js icon indicating copy to clipboard operation
glfx.js copied to clipboard

Can not export the modified image

Open glumb opened this issue 11 years ago • 4 comments

I'm trying to export an image from the canvas using canvas.toDataURL(). This does not work for me on Chrome nor Firefox. Also the 'canvas.toDataURL.html' test does not show a second exported image.

How to export or save a screenshot of the canvas the right way?

glumb avatar Dec 27 '14 17:12 glumb

I discovered, that it works, if we use the toDataUrl method which was removed in a8a03b40aa0cc1a822291aa6538efcd5f27b3de9

glumb avatar Dec 28 '14 11:12 glumb

Can you give an example of how you got this to work. I am struggling to export the canvas to an image.

stuarteaton avatar Jul 02 '15 13:07 stuarteaton

Hey @stuarteaton, add the method a8a03b40aa0cc1a822291aa6538efcd5f27b3de9 back to the source and try something like this:

that.renderingCanvas = fx.canvas();
that.renderingCanvas.draw(texture).perspective( //or any other transform
                    [0, 0, w, 0, 0, h, w, h],
                    points
                ).update();
that.renderingCanvas.toDataURL()

glumb avatar Jul 06 '15 17:07 glumb

Hi @glumb, I am also facing the same issue and I'm using npm package of glfx.js with react where exactly should I add metthod back to the source that.renderingCanvas = fx.canvas(); that.renderingCanvas.draw(texture).perspective( //or any other transform [0, 0, w, 0, 0, h, w, h], points ).update(); that.renderingCanvas.toDataURL()

Dineshruhela avatar May 10 '19 11:05 Dineshruhela