France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Getting a PNG Photo Image
I just tried your code and it worked as expected (under Mac OS X). You don't need to create the BufferedImage instance, and you can call create getOffScreenImage directly, as shown in this test case:
public class Export3DViewToPNG { public static void main(String [] args) throws RecorderException, IOException { Home home = new HomeFileRecorder().readHome("test.sh3d"); HomeComponent3D homeComponent3D = new HomeComponent3D(home); BufferedImage image = homeComponent3D.getOffScreenImage(400, 400); File file = new File("tmp.png"); ImageIO.write(image, "png", file); } }
Under which system do you work?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
----------------------------------------
[Edit 1 times,
last edit by Puybaret at Nov 2, 2010, 5:41:16 PM]
Joined: Mar 21, 2010
Post Count: 6
Status:
Offline
Re: Getting a PNG Photo Image
I just tried your code and it worked as expected (under Mac OS X). You don't need to create the BufferedImage instance, and you can call create getOffScreenImage directly
True, it works fine. It was a permissions problem with windows vista. Thanks for tip, i'm just a java newbie. I hope this changes in the future :)