|
-
Aug 30th, 2016, 03:18 PM
#1
Thread Starter
Banned
Find location on the screen
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 ?
-
Aug 30th, 2016, 03:32 PM
#2
Re: Find location on the screen
-
Aug 31st, 2016, 01:37 AM
#3
Thread Starter
Banned
Re: Find location on the screen
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.
-
Aug 31st, 2016, 01:44 AM
#4
Re: Find location on the screen
 Originally Posted by abhishek009
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 think that that's probably too vague a description for us to say what the issue might be. Please be specific. What EXACTLY did you do and what EXACTLY happened?
-
Aug 31st, 2016, 03:45 AM
#5
Thread Starter
Banned
Re: Find location on the screen
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.
-
Aug 31st, 2016, 02:14 PM
#6
Re: Find location on the screen
 Originally Posted by abhishek009
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.
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).
-
Sep 1st, 2016, 12:07 AM
#7
Thread Starter
Banned
Re: Find location on the screen
Thanks! Then how can I automate Web Browsers without inspecting HTML attributes ?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|