Remote Control Software

Hi there,

I'm building a desktop remote control application. I was looking at the Screen Grabber example ( http://java.sun.com/products/java-media/jmf/2.1.1/solutions/ScreenGrabber.html ) in order to be able to catch a desktop image and send it over the network. The example is using the robot.createScreenCapture(...) method to get the desktop image. This works fine if the image is small, but when it comes to grab a full screen image the program becomes terribly slow and it wastes a lot of memory. I suppose the caught image is not compressed at all and it is difficult to manage big images at a certain frame rate...

Is there any way to get a smaller desktop image in JAVA or I'm supposed to use some sort of native code and link it through JNI?

Thanks a lot

[791 byte] By [francesco78a] at [2007-10-3 11:51:50]
# 1

It might be better to have a copy of the last screen shot in memory, and compare it to the current screen shot.

Compare the two, and work out any differences.

Only send the rectangular areas which have changed.

I think the technique is called "dirty rectangles" or "dirty painting".

It's a well known graphics technique, to avoid repainting the entire screen contents, but is just as applicable here.

regards,

Owen

omcgoverna at 2007-7-15 14:25:58 > top of Java-index,Security,Cryptography...
# 2

That's for sure part of the solution in order to speed up the image processing...

But, do you think it is possible to grab a smaller image directly from the first capture operation (i.e. something similar to robot.createScreenCapture, but with a compressed image grabbing)?

After that it should be possible to apply the solution that you suggested...

Thanks a lot

francesco78a at 2007-7-15 14:25:58 > top of Java-index,Security,Cryptography...