Auxiliary
Auxiliary

Reputation: 2757

Java- screen capture behind the application

Is there a way to capture the screen but without the app itself getting shown. I know how to minimize or make a frame invisible but this has to be done real fast cos it's going to happen alot in each second (at least once every second). I want it to look something like the magnifier in Windows Vista/7. (The app can see behind itself.)

Upvotes: 2

Views: 2368

Answers (3)

Kalpesh Soni
Kalpesh Soni

Reputation: 7257

i think screencast o matic does just this?

Upvotes: 0

Cesar
Cesar

Reputation: 5488

Call setVisible(false) on your main JFrame before capturing the screen. When the screen capturing process is finished, call setVisible(true) to get your GUI showing up again.

To capture the screen, you can use the Robot class. It contains a createScreenCapture method that receives rectangle coordinates which will be captured in a BufferedImage.

Upvotes: 3

aioobe
aioobe

Reputation: 420991

This is not possible in Java without tight native integration with the window-manager of the platform in question.

Upvotes: 1

Related Questions