File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes saving an icon as BMP or jpeg... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "saving an icon as BMP or jpeg..." Watch "saving an icon as BMP or jpeg..." New topic

saving an icon as BMP or jpeg...

Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
Does java support this functionality ? that is , reading an icon and saving it as bmp or .jpg???
i saw on sun's site that j2se 1.4 has included the package imageio in 1.4.
Does it solve my purpose?
thanx in advance
Thomas Smets
Ranch Hand

Joined: Dec 11, 2001
Posts: 111
Yeap it should be do-able :
From ImageIcon
you can request the getGraphics()
One ce you have the graphic you should be able to use the class :

import com.sun.image.codec.jpeg.JPEGImageEncoder;
import com.sun.image.codec.jpeg.JPEGCodec;

To do whatever you want ...
But no GIF's due to Copyrights

Thomas Smets
Just another developper
I agree. Here's the link:
subject: saving an icon as BMP or jpeg...
jQuery in Action, 3rd edition