I have a sketch with processing in html5
that saves an image with SaveFrame()
; and opens in a new tab with data: image / png; base64," xxxxxx
I need to save the image that appears in the new tab in a database, but I do not know how to get it from the browser.
Initially I found this code to save the canvas and display it in an img tag:
var image = document.getElementsByTagName("canvas")[0].toDataURL();
// Record the data on the canvas to verify that it works
console.log (image);
// then you can place the image on your web page
document.getElementById ("theImage"). src = image;
But it does not work.
Note: I have the common version of processing no p5js.