Save base64 image from processing to php

0

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.

    
asked by Gian 04.12.2018 в 20:41
source

0 answers