aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes How to Active Screen Capture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to Active Screen Capture" Watch "How to Active Screen Capture" New topic
Author

How to Active Screen Capture

Waqas Tariq
Greenhorn

Joined: Nov 15, 2007
Posts: 17
sweet hello to all,
someone tell me that how can i capture the active screen(window) using java.
I have captured whole screen with createScreenCaputre() method. Now, i want to capture active window only.
How to do it
waiting . . .
best wishes
waqas dar
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39577
    
  27
Have a look at this previous discussion.


Ping & DNS - updated with new look and Ping home screen widget
Waqas Tariq
Greenhorn

Joined: Nov 15, 2007
Posts: 17
But, i did not find solution of my question from your previous discussion

there no solution of Active Screen Capturing in Java , i think.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39577
    
  27
How did you change your code after reading that thread? Are you passing the rectangle of the frontmost window to the createScreenCapture method?
Waqas Tariq
Greenhorn

Joined: Nov 15, 2007
Posts: 17
I tried to pass 'new Rectangle(this.getScreenSize)' but failed to compile.
Can you tell me , what should i pass to createScreenCapture for most front window?

waiting ... .
best wishes
Waqas Dar
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19556
    
  16

If that screen is part of your own application it's quite easy. However, it probably isn't, so I doubt there is anything you can do without using JNI, because you'll need to use the Windows / Xorg / XFree API.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39577
    
  27
You forgot the parentheses after getScreenSize. Also note that the method is part of the Toolkit class, so unless "this" is a Toolkit implementation -and I'm certain that it is not- it won't work the way you currently have it. The other discussion actually lists the code required - why don't you just copy and paste it?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Active Screen Capture
 
Similar Threads
Implement a screen capture tool in Java 1.2
ScreenCapture
Question about a screen capture tool.
Capturing ScreenShot of the the Active Window
Questions about a screen capture tool