wood burning stoves 2.0*
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

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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: http://aspose.com/file-tools
subject: saving an icon as BMP or jpeg...