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 ?