• Post Reply Bookmark Topic Watch Topic
  • New Topic

Export Applet to Image file

 
Ravi Gupta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to export an applet to an image of same size. Image format can be PNG or JPEG. How should I go about it?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can paint the applet into a BufferedImage's Graphics object, and then save that using the ImageIO class.
 
Ravi Gupta
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a ton. Will proceed as suggested and will post the code for others too.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!