Remote screen capture and control

I am doing a project on "remote screen capture and control" .... in java this is a desktop application ... thre is a client-server architecture .... here the server can capture clients and do wath on the client, but that is unknown to the client, that someone is watching him / her.

and after capturing the client, the server can also control the client from the captured data ..... and this is done on the client side ... automatically ... as controlled by the server ..... so I want your help ... please give me sentence....

+1


a source to share


2 answers


Check out the "java.awt.Robot" class:

http://java.sun.com/javase/6/docs/api/java/awt/Robot.html



These methods should help you:

BufferedImage createScreenCapture(Rectangle screenRect);
void keyPress(int keycode) 
void keyRelease(int keycode) 
void mouseMove(int x, int y) 
void mousePress(int buttons) 
void mouseRelease(int buttons) 

      

+2


a source


You have this article about the basics of screen capture using Robot (as suggested by brd6644's answer)

We can grab the entire desktop and save it as a PNG file as follows.

public void captureScreen(String fileName) throws Exception {
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    BufferedImage image = new Robot().createScreenCapture(new Rectangle(screenSize));
    ImageIO.write(image, "png", new File(fileName));
}

      



Alternatively, we could grab our JFrame, including its window decoration, as follows.

public void captureFrame(JFrame frame, String fileName) throws Exception {
    BufferedImage image = new Robot().createScreenCapture(frame.getBounds());
    ImageIO.write(image, "png", new File(fileName));
}

      

The old (2003) jxta-remote-desktop project might give you some pointers too

+1


a source







All Articles