• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

saving an icon as BMP or jpeg...

 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rashmi
 
Thomas Smets
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic