Re: [Sikuli-driver] [Question #678493]: How to take equal size screenshot

2019-02-12 Thread yashi rathore
Question #678493 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678493

yashi rathore confirmed that the question is solved:
Thanks RaiMan, that solved my question.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678493]: How to take equal size screenshot

2019-02-12 Thread yashi rathore
Question #678493 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678493

Status: Answered => Solved

yashi rathore confirmed that the question is solved:
Hi RaiMan,

Thank you, now image comparison is working perfectly

i used below code:

f.find(Pattern(os.getcwd()+'//test.png').exact())

This is giving me expected output

Thank you so much

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678493]: How to take equal size screenshot

2019-02-12 Thread RaiMan
Question #678493 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678493

Status: Open => Answered

RaiMan proposed the following answer:
Have a look at the similarity scores of the results and  you will see the 
differente.
Look into the docs of Finder for the options and features

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678493]: How to take equal size screenshot

2019-02-12 Thread yashi rathore
Question #678493 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678493

Status: Answered => Open

yashi rathore is still having a problem:
Thank you Raiman, above solution almost solved my problem, but now when
i am comparing, enabled image and disabled image ,it is showing
"similar".I have used below code to compare:

from sikuli import *
import sys
import shutil
import os

# contains the absolute-path-to-image-file-1
img1 = "file path" 
buttonReg = exists(img1, 0)
popup("disable the button and click ok")
regionImage = capture(buttonReg)
shutil.copyfile(regionImage, os.getcwd()+'//test.png')
f = Finder(img1)

 # searches and stores the matches in the Finder object f

f.find( os.getcwd()+'//test.png')
if f.hasNext(): # is None if nothing found
print("similar")
else:
print("not similar")
f.destroy()

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678493]: How to take equal size screenshot

2019-02-12 Thread RaiMan
Question #678493 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678493

Status: Open => Answered

RaiMan proposed the following answer:
yes, I agree: this is a missing feature.

But you can solve it with a small script:

- make a shot of the enabled button with as little background as possible (imgE)
- then take care that the enabled button is visible on the screen
- find the button imgE on the screen and save the match
- make the button disabled
- take a shot with the saved match region and save it

something like that:
buttonReg = exists("imgE", 0)
popup("disable the button and click ok")
capture(buttonReg).getFile("/some/folder", "imgD")

the disabled button should now be saved at "/some/folder/imgD.png" and
can be copied to your .sikuli using the second button from the left
(insert image).

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #678493]: How to take equal size screenshot

2019-02-11 Thread yashi rathore
New question #678493 on Sikuli:
https://answers.launchpad.net/sikuli/+question/678493

Hi,

I want to know how i can take screenshots of equal size , because i am trying 
to write some scripts to automate and i want to verify whether the button is 
enabled or disabled. I tried to take screenshot of disabled button two times, 
and when i compared  both of them using below code:

img1="path of img1"
img2="path of img2"

f=Finder(img1)
f.find(img2)
if f.hasNext():
  print ("similar")
else:
  print("not similar")

i got result as "not similar", but images are same, the problem is i am unable 
to take both screenshots of same size, slight difference is making the result 
false.

Thank you in advance

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp