aspose file tools
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 OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP 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
It is sorta covered in the JavaRanch Style Guide.
subject: saving an icon as BMP or jpeg...