Results 1 to 2 of 2

Thread: Color Detection

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2010
    Posts
    16

    Color Detection

    Is it possible for a program to look for a color, and then be able to detect it? Like for example you have a picture of the american flag, and you put in the exact blue thats on the flag, you turn on the program and it beeps it it has that blue? And I am not saying this for images spesifically, I'm saying on your general screen, or on a web browser within the program.

  2. #2
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Color Detection

    Yes, it is possible.
















    Oh, you want to know how? Well you should have said so...
    If you have an image you can loop through its X and Y coordinates and get the color at each of those coordinates (look up Bitmap.GetPixel).
    If you are talking about the screen in general, it is possible to get the color at a specific point but I don't know how. I'm sure google can tell you.
    As for comparing colors, use the = symbol.
    Code:
    If bmp.GetPixel(3, 15) = Color.FromArgb(139, 139, 100) Then '...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width