sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #28620
[Question #255516]: how to detect when screen changes - java
New question #255516 on Sikuli:
https://answers.launchpad.net/sikuli/+question/255516
I'm trying to determine the refresh rate of an animation so I need to test when the region changes. I wrote this code in Java to measure how frequently the screen is changing.
Region reg = new Region(500,500,10,10); // small region of the screen
reg.waitVanish(Screen.getPrimaryScreen().capture(reg), 10);
But this crashes with below.
[error] Region: doFind: invalid parameter: org.sikuli.script.ScreenImage@dc67e
[error] ***** Terminating SikuliX after a fatal error 999 *****
It makes no sense to continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.
I set debug=3, but it didn't show anything else. I changed the code to be
reg.waitVanish(new Pattern(Screen.getPrimaryScreen().capture(reg).getFile()), 10);
and this WORKS! but it is very slow, because of writing disk files.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.