我有一个JFrame应用程序,可以产生长时间的输出。我想知道我是否能录下来,并制作一个或多个帧/图像的高帧率,以转换成视频后?
发布于 2016-04-05 09:40:44
您可以生成JFrame内容的图像,如下所示:
public static void main(String[] a) throws Exception {
final JFrame frame = new JFrame("My Frame");
frame.getContentPane().setBackground(Color.CYAN);
frame.setSize(400, 400);
frame.setVisible(true);
final BufferedImage image = new BufferedImage(frame.getWidth(),
frame.getHeight(), BufferedImage.TYPE_INT_ARGB);
frame.paint(image.getGraphics());
File outputfile = new File("C:/Temp/frame.png");
ImageIO.write(image, "png", outputfile);
}然后使用众多的软件转换器中的任何一个可以用来制作视频。
https://stackoverflow.com/questions/36422170
复制相似问题