← Back to team overview

sikuli-driver team mailing list archive

[Question #673704]: How to get program to capture part of the App.focusedWindow()?

 

New question #673704 on Sikuli:
https://answers.launchpad.net/sikuli/+question/673704

How to decrease the size captured?  the app is 1200x720, but I just want to capture 800x600 to compare them, Thanks in advance!

My Code is as Follows:

some_region = App.focusedWindow()
imgabc = capture(some_region)
screenshotsDir = "D:\Sikuli1.1.3\Reports\Screenshot"
shutil.move(imgabc, os.path.join(screenshotsDir, "A.png"))      
  
wait(1)  

baseimg = os.path.join(dir, "A.png")

wait(10)  
img = os.path.join(dir, "B.png")
shutil.move(capture(some_region), img)

f = Finder(baseimg)

f.find(Pattern(img).similar(0.85)) 
if f.hasNext():
        print "Image is matching"
else:
        print "Image is not matching"
f.destroy()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.