Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Does ImageIO.write of GIF support transparent?

807599Apr 21 2007
I have been use ImageIO.write and BufferedImage to save current Panel's paint(). with transparency.
BufferedImage image = new BufferedImage(panel.getWidth(), panel.getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = image.createGraphics();
components[0].paint(g2);
g2.dispose();
final File file = new File(save_File, "tt.png");
ImageIO.write(image, "png", file);
success at PNG with transparency.

but now I want to save as GIF file,not png.
but I change png -> gif
final File file = new File(save_File, "tt.gif");
ImageIO.write(image, "gif", file);
it will be all black color picture.
Why?
And how can I success to do this.

Does ImageIO.write of GIF support transparent?
Or it should be some other setting ?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 19 2007
Added on Apr 21 2007
0 comments
64 views