Forum Discussion
4 Replies
Sort By
- lsainsburyContributorDeleted original post as you can't check an image within an if statement as far as I can see but will post another reply soon :)
Edit:
Can you not do something like
(If) Object Property of Drawing is Visible (then) Compare Pictures
(else) Do something else
I think that makes sense, as if the drawing is not visible then there's no point comparing the images to check if they are the same, but if its visible then check if they are the same or move on to your else. - Rafael_FradczykOccasional ContributorThanks for your answer, but that's not exactly what I wanted to do. In your scenario I first check if the image is visible and then compare the image to another. But what I wanted was, first compare the image to another and then depending on whether the image is the same or not do something.
I solved it now as follows:
1. ComparePictures
I stored one picture in regions and compared it to an onscreen object
2. If...then
LastResult equals true
Now if the images are the same the "then" condition will be executed otherwise the "else" condition. - lsainsburyContributorYeah that sounds correct, sorry I misunderstood your question, but atleast you have solved your issue now :)
- Colin_McCraeCommunity HeroI don't think you did.
What if the onscreen object is not present/visible?
I assume you have some sort of error handling in there to account for this. Otherwise, I would suggest Lee's original answer (only compare if it's present in the first place) makes more sense ...