Problem in capturing a region

Asked by Prateek Sahu

I am using the following code to capture region

def captureContent():
        return capture(Region(region.x + 1, region.y + 1, region.w - 2, region.h - 2))

#Code to capture region
capture(Region(1, 104,1792,873))
r= captureContent()
print r

Now the print statement is printing the path where the image is saved.
C:\WINDOWS\Temp\sikuli-scr-6265876359948695797.png

But the image is not in Temp folder I have treid many times but I can not find the image...
Please Help..

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

after capturing an image this way, you have to move it to a safe place, since the temp images are purged, when the script ends.

import shutil
img = capture(someRegion)
shutil.move(img, "path-to-some-folder-imagename.png")

Revision history for this message
Prateek Sahu (prateek-sahu01apr) said :
#2

Thanks RaiMan, that solved my question.