Print at Dec 15, 2025, 6:44:17 PM

Posted by javivf at Nov 2, 2010, 3:51:07 PM
Getting a PNG Photo Image
Hi there,

I'm trying to save a png image with this code but not works :


HomeComponent3D homeComponent3D = new HomeComponent3D(getHome());
int imageWidth = 400;
int imageHeight = 400;
BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
image = homeComponent3D.getOffScreenImage(imageWidth, imageHeight);
File file = new File("tmp.png");
ImageIO.write(image, "png", file);


Anybody can tell me what i'm doing wrong?

Thanks.