How to capture image of a region in the script?

Asked by Chengpu Wang

Hi,
I am upgrading a existing product. My first job is to capture the behavior of the current product. The output of the product are graphs and table outputs in fixed locations controlled by four combo boxs, each of which has a long list. I have manually snap shot the outputs of one set of combo box selections. The question is: given the manually snap-shoted regions from one selection, what is the script function to capture a image from a region? I have scanned through the Q&A and can not find anything relavent to this question.
Thanks,
CP

Question information

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

img = capture(<a valid region>)

img is a png file in temp storage at that moment.

You might use it in subsequent image based operations (find, click, Finder, ...) or save it to a place of your choice using shutil.move()

Revision history for this message
Chengpu Wang (chengpu) said :
#2

Thanks