Java3D 对象导出为 BufferedImage

发布于 2024-11-29 15:25:20 字数 143 浏览 2 评论 0原文

-- 可能这个问题以前就已经存在过,但我在任何地方都找不到答案。 --

我设计了一个Java3D对象,它由不同的形状、不同的颜色和闪电效果组成。现在我想将此对象导出为 BufferedImage。有什么办法可以做到吗。请分享您的想法。

谢谢

-- may be this query has been on circuit before but I can't find an answer anywhere. --

I have designed a Java3D object which is composed of different shapes, with different colors and lightning effects. Now I like to export this object as BufferedImage. Is there any way to do it. please share your thoughts.

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↘紸啶 2024-12-06 15:25:20

如果我理解你的问题,听起来你想截取当前 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"));

source: http://www.java-tips.org/java-se-tips/java.awt/how-to-capture-screenshot.html

If I understand your question, it sounds like you want to take a screenshot of the current 3D scene? If so, you might want to look at the java.awt.Robot class, something like the following:

        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"));

source: http://www.java-tips.org/java-se-tips/java.awt/how-to-capture-screenshot.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文