Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Saving a an image written to a graphics context to a jpeg

Thread view: 
michapringle@gmail.com - 27 Apr 2006 23:39 GMT
anybody got some code on how to do this? I'm no graphics master.
Rhino - 28 Apr 2006 00:35 GMT
> anybody got some code on how to do this? I'm no graphics master.

I don't know how to do it myself but I'm certain this has been asked - and
answered - on one of the comp.lang.java.* newsgroups in the past, probably
this one.

Do a Google Groups search and you should be able to find it easily enough.

--
Rhino
RealGagnon - 28 Apr 2006 02:04 GMT
> anybody got some code on how to do this? I'm no graphics master.

You need a package called Jimi  http://java.sun.com/products/jimi/

Simple example at http://www.rgagnon.com/javadetails/java-0266.html 

Bye.
Signature

Real Gagnon  from  Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to  
* http://www.rgagnon.com/howto.html

hiwa - 28 Apr 2006 07:41 GMT
An interesting read:
http://today.java.net/pub/a/today/2006/04/20/bringing-swing-to-the-web.html
Thomas Weidenfeller - 28 Apr 2006 08:08 GMT
> anybody got some code on how to do this? I'm no graphics master.

As has been discussed here many times, you can't in a general way. You
need to know the entity behind the Graphics context (where the
Graphics[2D] object came from). That entity might buffer, and it might
provide methods to fetch that buffer. But there is no guarantee.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

Knute Johnson - 28 Apr 2006 15:46 GMT
> anybody got some code on how to do this? I'm no graphics master.

One simple way is to create a BufferedImage, get a Graphics from it and
pass it to the drawing method.  Then save the BufferedImage to a file.
Of course this assumes that your drawing method doesn't do a bunch of
other stuff that will mess this up.

Signature

Knute Johnson
email s/nospam/knute/

michapringle@yahoo.com - 29 Apr 2006 02:09 GMT
Thanks guys. This should help quite a bit.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.