I am planning to write a "Terminal Service" or "VNC" pure Java program (no native code), that is Plataform-independent and efficient. So, I was planning initially to take screenshots of the screen, about 3 a second minimum.
I wrote this code (below), but each screenshot takes about 300ms to be taken, on a 900MHz Athlon machine, 1024x768x32Bit resolution. I tested then on a Athlon XP 2700+ machine, and it took about 100ms to take a 1280x1024x32Bit screenshot.
I need to reduce this time to about 30ms on a fast machine and 100ms on a slow machine (like Pentium III 500MHz), is there any way to do that?
Any ideias, code, links etc would be VERY welcome.
Thanks for any reply!
<b><i>Bengt Hammarlund</i><br />� Sun Certified Java Programmer</b>
Joined: Oct 17, 2003
I just tested the same program with the same 900MHz machine, but a 16Bit (1024x768).
The time it took for each screenshot increased!! It went to about 300ms to 400ms! Testing again on 32Bit, it took the usal 300ms. I guess my video hardware is optimized for 32Bit color...?
so, the speed of the screenshot depends on how fast is the graphics card?
Please, if you got any spare time, test this code on your machine(s) and post the avarage time for each screenshot, and your computer configuration (CPU, Graphics card).
thanks for the replyes guys. I don't think I can do it in Java, actually. I would have to: 1) control mouse and keyboard devices from remote computer (is it possible?) 2) get screenshots, at least 3 per second, and hopefuly get from screen only what changed to send to remote computer view client (don't think it's possible too)
I think that both problems above demand native code, so a pure Java implementation is, at least in my head, impossible.
Thanks for all your help guys!
subject: Is there a efficient way to take a screenshot in Java?