If a pixel on a certain position of my screen is blue, press the down key.
How do I code this?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Danatas GerviPosted Aug 2, 2009, 5:54 AM
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (this.BackgroundImage != null)
{
Color underColor = ((Bitmap)this.BackgroundImage).GetPixel(e.X, e.Y);
if (underColor == Color.Blue)
{
OnKeyDown(new KeyEventArgs(Keys.Down));
}
}
}
If you want to get color from any place on screen - I think you should use Windows API....