Finding the position of a certain picture on the screen

  • Thread starter Thread starter ofiras
  • Start date Start date
O

ofiras

Hi everyone,
I need to make a program in c# that will find a certain picture (not a
big picture, few pixels in a certain formation, which is not
necessarily a rectangle) on the computer screen. I haven't really done
something like that before, so I'm not sure how to do it.
what I had in mind was taking a screenshot (I found a tutorial that
explains how) and then start checking every pixel in the screenshot
until I find one that looks like one of the pixels in my picture, and
then check if there are pixels next to him that are same to the ones
in the picture, and in the same formation.
This would be quite complicated for me, since I never worked with
pictures in c#, so I thought maybe someone here has a tutorial of how
to do it, or maybe another idea.
Please help,
Ofir.
 
Hi everyone,
I need to make a program in c# that will find a certain picture (not a
big picture, few pixels in a certain formation, which is not
necessarily a rectangle) on the computer screen. I haven't really done
something like that before, so I'm not sure how to do it.
what I had in mind was taking a screenshot (I found a tutorial that
explains how) and then start checking every pixel in the screenshot
until I find one that looks like one of the pixels in my picture, and
then check if there are pixels next to him that are same to the ones
in the picture, and in the same formation.
This would be quite complicated for me, since I never worked with
pictures in c#, so I thought maybe someone here has a tutorial of how
to do it, or maybe another idea.
Please help,
Ofir.

How do you have the match picture defined if it is not necessarily a
rectangle?

Your brute force method should work, with a rectangular match picture.
What steps are you having a problem.

I suspect there is a better way to do this by xor'ing the image, but
that is just a hunch on my part.
 
Back
Top