Hello,
Is there any way to find source image and compare it with the screen shot of the current screen ? If the image matches with the current screen shot image then it should find X and Y of the matched image. Is it possible ?
Printable View
Hello,
Is there any way to find source image and compare it with the screen shot of the current screen ? If the image matches with the current screen shot image then it should find X and Y of the matched image. Is it possible ?
Thanks! It's working but it doesn't provide the accurate X and Y location where the image found. For example, I have taken the screenshot of my desktop and stored it in bitmap. And in other file I have saved the some part of the desktop and tried to compare, location found but it was not accurate. Why ? I have checked several times but same result. What could be the issue ? Actually what I want to do is that find location with Image and set cursor on that area and perform some action.
I'm trying to automate external application which is loaded on web browser. I get screenshot of the chrome window. Then I want to find the location of search window, so I took the screenshot of that area of search. and then matching that area with the entire screenshot and then using SerCursor I set the cursor with found location and then perform some operations.
Can only guess you have an offset somewhere, either in the code or in the images, e.g., the browser scrollbars were scrolled when you captured the images and is not scrolled at compare time. Other then that the code in the link seems to work fine here except when the find image is at the very-bottom-right of the full image, then its not found, to fix that I removed the -1 from the x and y for-loops in Function FindMatch.
BTW, instead of using SetCursor API you can use Cursor.Position = New Point(x,y).
Thanks! Then how can I automate Web Browsers without inspecting HTML attributes ?