0

Note: .toDataURL() and "todataurl-png-js" are NOT usable

Say I wanted to construct an image in PHP from a canvas element's RGB data that is sent from JavaScript (getImageData), how would I accomplish this? More specifically, how would I first get the RGB data and put in the proper format (for use in PHP) and how would I assemble it properly into an image?

*Edit: It is preferred that this simply (if possible) be done from the data in getImageData().data

4

1 回答 1

0

You can convert canvas data to javascript.

More about canvas Info: http://code.google.com/p/canvg/

How to convert canvas to Image. http://www.nihilogic.dk/labs/canvas2image/

If you want to store that image on server side, pass base64 string to php page and save it there.

于 2012-07-07T02:58:30.227 回答