Pixel Color search where the cursor is

drunkguy564

New member
Joined
Jun 9, 2016
Messages
2
Programming Experience
Beginner
Firstly i want to say that i'm not english and completely new to visual basic, c#,windows forms .. So sorry for my english and questions that might be dumb for some of you!

So i have a button(pixelSetColor) and what i want to do is when i click on it is that a message box appears and when i press space(to make the message box disappear) it takes the color of the pixel where the cursor currentli is and apply it to a variable(here "pix" is the variable). And I have here a label(lblPixelColor) wich i want to show me the hexadecimal value of the color with the variable.

This is what i've done

private void pixelSetColor_Click(object sender, EventArgs e)
{
MessageBox.Show("Place the cursor on the color you want to be found by the bot then press space");
Color pix =
lblPixelColor.Text = (pix.ToString());

Please help me and if you write some code please explain every single thing you do !

Thanks a lot !
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
895
Location
Norway
Programming Experience
10+
It is normally achieved by taking a screenshot of the screen and get the pixel at mouse location from that image. It should not be difficult to find resources on internet of how to do both these operations.
 

drunkguy564

New member
Joined
Jun 9, 2016
Messages
2
Programming Experience
Beginner
It is normally achieved by taking a screenshot of the screen and get the pixel at mouse location from that image. It should not be difficult to find resources on internet of how to do both these operations.

Thank you, i'll tell you if i find :)
 
Top Bottom