Capturing DirectX Programs Using Java

I wrote a Java application that uses java.awt.Robot to capture a screen on a screen and wondered if it is possible to capture a program using DirectX / OpenGL?

Every time I try to do this, I get a black screen

0
java directx opengl
source share
4 answers

Yes it is possible. But perhaps only in limited quantities.

I successfully grabbed the contents of OpenGL windows (jogl) on Linux and Windows using Robot createScreenCapture .

Some specific implementation information that may be different for you:

  • A call to createScreenCapture was made from an OpenGL expression.
  • The application uses heavyweight GLCanvas
  • He used Java 6

Make sure you give it the correct coordinates. You can get screen coordinates for using GraphicsEnvironment

0
source share

I donโ€™t know if this is really a solution, but maybe there are more possible ways to get the screenshot information using โ€œFrameGrabberโ€ or some class associated with it from JavaCV: http://code.google.com/p/javacv/ Some final result shown on the screen can be calculated on a graphic card in which shaders are configured to work with image data before it is placed in the display buffer for the one shown so that some effects would not be possible to capture without an analog loopback (transition from video output to the video on the capture card) .

Related post How to quickly take screenshots in Java?

+1
source share

OpenGL is a drawing API, not a universal interface to a graphics system. There have been times when screenshots with OpenGL were really possible through some dirty hacks. However, recently I tried to re-implement this on a modern OS to make sure that it still works, and no, it no longer works.

+1
source share

Uhh ... hard, o)

I had an attempt to use some other utilities to take screenshots and get a black screen. DirectX seems to send the graphics directly to the monitor output. I am wondering if it is possible to access in a Java application.

0
source share

All Articles