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.
Printable View
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.
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.
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??
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.
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.
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.