This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
I need to overlay text onto a jpeg file then save the combined effect into one jpeg file. Can this be done with Image and Graphics classes? I am not having much luck.
posted 14 years ago
You might want to check out the Java Jpeg Encoder at: http://www.obrador.com/essentialjpeg/jpeg.htm Once you've got a Graphics object or Image with the desired graphics and text, you can use the JpegEncoder to write it to a Jpeg. There are also Gif encoders available (see www.acme.com), although technically you need a license from Unisys if you plan on using the gif encoding algorithm in your program.