I have a paint application that runs as a Java applet. I need to save the contents of the canvas on server machine in any image-format typically PNG. Please help!
+3
A:
You need to do two things:
- Generate an PNG image file in your applet - Writing/Saving an Image
- Post the image file to some server-side CGI/servlet which will store the image - How do I upload a file to my servlet or JSP?
What are you running on the server? PHP? Rails? JSP? .NET?
spilth
2008-12-30 14:53:02
Swanand
2008-12-30 15:26:03
+1
A:
You might be interested by the code I wrote for Processing, which is basically Java code. Re: save to web --- image export. Earlier in the thread I explain some precautions to be taken with such application (to avoid flooding a server from a malicious user) and I give the corresponding PHP code.
PhiLho
2008-12-30 16:35:27
That code worked well for me. What I was looking for was a way to export the canvas content. I did that using the Canvas class in g2d library.
Swanand
2009-01-27 13:52:24