• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to save applet in image (gif/jpeg) format.

 
Ravi Sinha
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there !
how to save applet in image (gif/jpeg) format. i have just gone through JIMI package where serilization is there ,WHERE U CAN SORE in image format ...........can anybudy help me out.........if possible then pleeez provide me some example.
Thanks in advan...........
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can save an applet as a GIF/JPEG just like any other visible component (there are many ways to do this... if you can use newer functions you can use the Robot class, or ImageIO, otherwise you are stuck with the old JPEGEncoder or third party libraries to save image types.), however, being an applet, the only place you could save it to would be the server. If you are trying to save the image to the users computer, you would have to have a signed applet with a proper security policy, etc. to do this.
 
Ravi Sinha
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks !! But can u provide me some code sample for this. I m going through JIMI Package.
ravi
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is a quick example... a really important part of the code (where it gets an output stream to the server) is blank because the way you are going to write your image depends on a few things... check out this discussion on experts-exchange.com to see a good range of options you could do to actually write the file to the server.

Here's the applet code -

[ February 04, 2004: Message edited by: Nathan Pruett ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!