← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #216219]: How to watch a screen and make screenshots of regions

 

Question #216219 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/216219

    Status: Open => Answered

j proposed the following answer:
Try this: 
import shutil

def changeHandler(event):
    shutil.copyfile(capture(event.region),"C:\\my\\dir")

reg = Region(0,0,500,500)
reg.onChange(50, changeHandler)

reg.observe(500)

You only have to replace "C:\\my\\dir" with your target image directory,
Region(0,0,500,500) with the region you want to observe and set the
number in observe() to the number of seconds you want your script to
observe the region.

If you have any more questions, please aks :-)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.