1

I am developing RDP Application. Where server has to send the dirty parts of the screen and client has to update that part of image. I am able to send the total screen of desktop using Robot class as

BufferedImage bufferedImage = robot.createScreenCapture(new Rectangle(0,0,Toolkit.getDefaultToolkit().getScreenSize().width,Toolkit.getDefaultToolkit().getScreenSize().height));

If I want to send dirty parts of screen to client, then how to identify the dirty region of desktop screen and capture that screen.

Could please tell me the procedure to identify the dirty regions of screen in java.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
mini
  • 855
  • 4
  • 15
  • 22
  • 7
    You should accept more answers. – BevynQ Jan 17 '13 at 05:42
  • 1
    This isn't really possible with Java. The best you can do is start a thread and periodically probe the mouse position, when it changes, you could try and calculate the change between the old and new positions and set a screen shoot of the area covered by it. Your only other choice would be to create a JNI connection to the underlying OS and hope it has some kind of notification frame work :P – MadProgrammer Jan 17 '13 at 05:44
  • 4
    It will be slower than the methods alluded to by @MadProgrammer, but one crude way to do it is: 1) Take a screenshot. 2) At a later time, take another screenshot. 3) Compare them pixel x pixel or (faster) byte by byte. 4) Encapsulate the changed regions into a series of pics, along with location information. -- Oh, and also transmit the mouse location, so it can be drawn in later on the client. – Andrew Thompson Jan 17 '13 at 05:54
  • How to identify the dirty region screen by comparing 2 images – mini Jan 18 '13 at 12:20
  • *You should accept more answers.* As noted by @BevynQ yesterday. – Andrew Thompson Jan 18 '13 at 22:47

0 Answers0