Results 1 to 7 of 7

Thread: Need To Know

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2012
    Posts
    3

    Need To Know

    Is it possible to detect a change in color on a certain spot on your screen and press a key accordingly?? Sorry, I'm trying to learn VB.

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Need To Know

    What do you mean by press a key accordingly ? It sounds like you want the computer to detect the change and then press a key but since computers can't really press a key, I don't think that's what you really meant. I'm thinking you meant simulating a key press. Please clarify.

    Also why do you want to detect a change on the screen. I can think of one way to do that but its terribly in-efficient and I can't really think of a practical use for such a function.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2012
    Posts
    3

    Re: Need To Know

    basically its for a game me and my friend created........itll detect the change in color from grey to red in 4 diffrent regions and for example if its the up arrow it will press the up key? is that clear enough??

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Need To Know

    Well if you wrote the game then presumably its your code that's changing the colour in the first place. There is no need to detect something that you yourself are responsible for in the first place.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2012
    Posts
    3

    Re: Need To Know

    We are trying to figure out how good a automatic system can detect a random change in 4 diffrent locations

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Need To Know

    Quote Originally Posted by DarkFangz View Post
    We are trying to figure out how good a automatic system can detect a random change in 4 diffrent locations
    As Niya suggested, not very well if you're using screen detection. You'll always be far better off intercepting the event/procedure that actually causes the change than trying to detect that it has happened. I appreciate that this is not always possible (if you were using a color picker on an image, for example) but in this case it certainly seems that it would be the best option.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  7. #7
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Need To Know

    Ya, screen detection even when most necessary is a shoddy solution at best. In this case I would absolutely not recommend it. GDI is too limited for any good implementation of such a thing.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

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