Select area of screen (trying to crop an image)

Asked by burblespork

In the middle of a script, I'm trying to allow the user to select an area of a photo to crop before the script continues on with other standard modifications to the photo. Since the photo is different every time, the coordinates on the screen changes every time and there is no consistent image in that area that I could point to for drag and drop. Any ideas on how to proceed with this? Thanks!

Question information

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

the user interaction should look like this:

popup("Be ready!")
pic = capture() # this enters interactive mode, user captures and filename of result saved in pic
m = find(pic) # produce a Match object that you can use with dragDrop()

This is the theory - in reality be aware:
- (interactively) captured areas are only found in the moment if at least one dimension is smaller than 200-300 pixel (bug reported and accepted) so be sure you test your match (go on only <if not m:>)

Revision history for this message
burblespork (burblespork) said :
#2

Thanks RaiMan, that solved my question.