java.awt.Robot - new programmer, need a little help.

N

New Programmer

I work in test automation. I would like to develop a small new way to record and playback using java. I'm interested in the java.awt.robot class, and using the createScreenCapture. This captures a rectangle area. There are other apps out there that allow a user to select an area, and capture an image for playback. That being said, I think a better way would be if there wasa grid overlaying the app screen you are recording. by clicking within oneof the rectangles, the java program could automatically recognize the coordinates of the rectangle within the grid and auto save that image to a defined directory. This eliminates teh step of selecting an area, and provides faster recording.

Does any have any ideas how i could create/use a grid to pre define coordinates?
 
J

John B. Matthews

<638a98f4-c108-4356-b483-5696963febd8@glegroupsg2000goo.googlegroups.com
New Programmer said:
I work in test automation. I would like to develop a small new way to
record and playback using java. I'm interested in the java.awt.robot
class, and using the createScreenCapture. This captures a rectangle
area. There are other apps out there that allow a user to select an
area, and capture an image for playback. That being said, I think a
better way would be if there was a grid overlaying the app screen you
are recording. by clicking within one of the rectangles, the java
program could automatically recognize the coordinates of the
rectangle within the grid and auto save that image to a defined
directory. This eliminates teh step of selecting an area, and
provides faster recording.

Does any have any ideas how i could create/use a grid to pre define
coordinates?

You can ask the java.awt.Toolkit to getScreenSize() and divide the real
estate in whatever way makes sense to your application. You could then
send the resulting rectangle(s) to createScreenCapture().

Why not just capture the whole screen in the first place?

There are some example here:

<http://stackoverflow.com/questions/3742731>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top