Clicking on a certain color

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maffyx
    New Member
    • Mar 2007
    • 6

    Clicking on a certain color

    I have a question, is it possible to write a command so that the application searches the screen for a certain color and clicks or right clicks on where that color was found? Edit:this is for VB.net, sorry.
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Originally posted by Maffyx
    I have a question, is it possible to write a command so that the application searches the screen for a certain color and clicks or right clicks on where that color was found? Edit:this is for VB.net, sorry.
    Is this a Windows or Web application?

    Nathan

    Comment

    • Maffyx
      New Member
      • Mar 2007
      • 6

      #3
      Originally posted by nateraaaa
      Is this a Windows or Web application?

      Nathan
      It would be a Windows Application

      Comment

      • Maffyx
        New Member
        • Mar 2007
        • 6

        #4
        Anyone have any suggestions?

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Hmm if you could get a Graphics object that contained the whole screen.
          Actually, I thinjk you can. I seem to recall immitating the PrintScreen effect in a program once.
          Once you have the whole screen Graphics, you can make a bitmap of it.
          Then search the pixels of the bitmap for the Color you are looking for.

          Then it gets tricky but you need to like create an instance of the Message object that contains the like WM_LeftClick id along with values for (x,y) coordinates.

          Start by looking up how to get the "screen image" data or something and maybe that will help?

          Comment

          • Maffyx
            New Member
            • Mar 2007
            • 6

            #6
            Originally posted by Plater
            Hmm if you could get a Graphics object that contained the whole screen.
            Actually, I thinjk you can. I seem to recall immitating the PrintScreen effect in a program once.
            Once you have the whole screen Graphics, you can make a bitmap of it.
            Then search the pixels of the bitmap for the Color you are looking for.

            Then it gets tricky but you need to like create an instance of the Message object that contains the like WM_LeftClick id along with values for (x,y) coordinates.

            Start by looking up how to get the "screen image" data or something and maybe that will help?
            Awesome thanks, sounds like something like that would work, but how fast do you think it would be able to recognize it?

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              The color? That depends.
              (Unless there's something better to use in like directx/gdfx libraries)
              Assuming worst case, you would have the Height x Width number of pixels to examine from your graphics.
              If you could hint at where to start looking it would probably help.
              It may also help to divide the image up into sections and have it scan in seperate threads?

              Comment

              • Maffyx
                New Member
                • Mar 2007
                • 6

                #8
                Originally posted by Plater
                The color? That depends.
                (Unless there's something better to use in like directx/gdfx libraries)
                Assuming worst case, you would have the Height x Width number of pixels to examine from your graphics.
                If you could hint at where to start looking it would probably help.
                It may also help to divide the image up into sections and have it scan in seperate threads?
                Well the color would only be in one part of the screen so I guess that could narrow it down a bit. This section would normally be in the center of the screen in about a 600x600 is square.

                Comment

                Working...