• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting an applet into gif or jpeg

 
Nilesh Soni
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am drawing some lines or any shapes in an applet. now i want to save that drawing or applet into an image like gif or jpeg. one funda is that we will click on one button on applet, it will contact a setvlet on the server and on the server i have to write some code. can any one help me out in this regard as i need it very very urgent.
thanks.
------------------
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to convert the applet's canvas into a bitmap, convert the bitmap into JPEG or GIF format, then send the bitmap in a binary file transmission to the server. The server really can't do anything but catch the file - all the work has to be done on the client.
As far as getting the bitmap and converting it to image file format, I recommend you ask in the AWT/Swing forum.
For object-oriented drawing, you might find it better to render the objects from a list of graphics objects in the applet and transmit the list as a file - this is actually preferable if some other user would be viewing the graphics later, as different users may have different screen resolutions. The downside is that there's no real standard builtin to browsers for object-oriented image display, so you'd have to use a display applet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic