JSP - image problem... Help PLEASE!

S

Slava

Hi,

I have a JSP that needs to open a gif file and convert Image type to BufferedImage

I have something like this:
Image image = java.awt.Toolkit.getDefaultToolkit().createImage("image.gif");

how to convert it to BufferedImage ?

Any thoughts would be appreciated!
Thanks!
mnemonik23
 
C

Chris Smith

Slava said:
Hi,

I have a JSP that needs to open a gif file and convert Image type to BufferedImage

I have something like this:
Image image = java.awt.Toolkit.getDefaultToolkit().createImage("image.gif");

how to convert it to BufferedImage ?

It's worth checking first to see if it is a BufferedImage (using
instanceof)... and if not, you'll need to create a new BufferedImage of
the same size and draw the first image to it using its Graphics
interface.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top