--可能这个问题之前已经出现过,但我在任何地方都找不到答案。--
我设计了一个Java3D对象,它由不同的形状组成,具有不同的颜色和闪电效果。现在我想将这个对象导出为BufferedImage。有没有办法做到这一点。请分享你的想法。
谢谢
发布于 2011-08-17 09:56:19
如果我理解你的问题,听起来你想截取当前3D场景的屏幕截图?如果是这样,您可能需要查看java.awt.Robot类,如下所示:
Robot robot = new Robot();
// Capture the screen shot of the area of the screen defined by the rectangle
BufferedImage bi=robot.createScreenCapture(new Rectangle(100,100));
ImageIO.write(bi, "jpg", new File("C:/imageTest.jpg"));来源:http://www.java-tips.org/java-se-tips/java.awt/how-to-capture-screenshot.html
https://stackoverflow.com/questions/7074869
复制相似问题