• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving a graphics to an image

 
john kalaigian
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say i have a regular BufferedImage and I draw a polygon ROI over it. I want to be able to save the ROI and the underlying image as a new jpg image - does anybody have simple code to do what I just described? Or at least can you tell me how I can get access to the Graphics2D objects themselves and burn them onto the image
 
Dan Cranmer
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at this article, it might answer some of your questions:
http://www.javaworld.com/javaworld/jw-05-2000/jw-0505-servlets.html
 
Chad McGowan
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java advanced imaging api should have everything you need. There are encoders and decoders available (including jpg). There is also a tutorial on how to use jai on sun's web site.
API
JAI Download
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!