JPanel to transparent BufferImage
Hello,
I'm trying to capture a JPanel to a BufferImage. The JPanel contains a lot of transparent images that are drawn on it. I want to capture it to a BufferImage that will remain transparent, but I can't seem to figure out how to do so. Any help would be greatly appreciated.
Here is the code I'm currently using:
BufferedImage image =new BufferedImage(panel.getHeight(), panel.getWidth(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = image.createGraphics();
panel.paint( g2d );
g2d.dispose();
Thanks,
Collin

