IDE: Region(x, y, w, h) gets thumbnail when reopening script

Asked by Kurt Zalkowitz

Hi,

I have a question and I am not sure if this behaviour is supposed to happen. If I restrict the search area to a region with the parametres

searchregion = Region (x,y,width,height)

and save the script close Sikuli and restart it all coordinates are gone and I have a picture instead. This should not happen because I don't know the coordinates and have to find them again - every time. There should be no picture of the current screen but the coordinates I assigned before.

best, KZ

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Kurt Zalkowitz
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

This is because in the IDE, the result of the button selectRegion() is displayed as a thumbnail.

this only happens, if there is something found like
Region(x, y, w, h)

where x, y, w and h are all integer numbers, when loading/opening a script

To avoid this just write e.g.

searchregion = Region (0+57, 50, 600, 400)

or if it makes sense for other purposes, use variables instead of at least one of the numbers, e.g.

w = 800
h = 400
r1 = Region(50, 50, w, h)
r2 = Region(300, 300, w, h)

Revision history for this message
Kurt Zalkowitz (34g18lf3dr10mafs) said :
#2

Ok I see. Thx for the advice.