使用 java 在全屏应用程序中截取屏幕截图? [英] Take screen shots inside of full screen applications with java?

查看:47
本文介绍了使用 java 在全屏应用程序中截取屏幕截图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是使用 Java Robot 类截取屏幕截图的标准方法,即:

I'm using the standard method of taking screenshots using the Java Robot class, i.e.:

BufferedImage screencapture = robot.createScreenCapture(new Rectangle(tool.getScreenSize()));

这在大多数情况下都可以正常工作,但它只会拍摄全屏应用程序内的空白屏幕(我使用的是 Windows 7,因此其中大部分使用 Direct X 进行全屏显示).这是 Robot 类的已知问题还是我做错了什么?

This works fine most of the time, but it just takes pictures of a blank screen inside of full screen applications (I'm using Windows 7, so most of these are using Direct X for fullscreen). Is this a known problem for the Robot class or am I doing something wrong?

推荐答案

Robot 类无法捕获全屏 DirectX 或 OpenGL 应用程序.

The Robot class cannot capture fullscreen DirectX or OpenGL applications.

我刚刚在 Google 上做了一些快速搜索并找到了 JavaCV.与仅使用 Robot 相比,它更多,但是 JavaCV(主要是 OpenCV 包装器)应该允许您这样做.(不过不要引用我的话)...

I just did some quick Google'ing and found JavaCV. It will be a lot more involved than just using Robot, but JavaCV (mainly the OpenCV wrappers) should allow you to do this. (Don't quote me on it though)...

这篇关于使用 java 在全屏应用程序中截取屏幕截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆