C# mouse movement

05/12/2015 21:20 lovdo#1
I have been working on a pixelbot and it is going pretty good.
The only problem I have is that I want it to pick the pixel what is the closest to the centrum of my screen. (My screen is 22 inch big)

At the moment it picks pixels which are far away from the centrum and it is not efficient, but I don't know how to write this kind of code. (It needs to pick pixels close to the centrum because at that way my bot will work much faster)

I hope somebody can help me, in the mean while I will try to find something on my own.
05/12/2015 21:30 snow#2
#moved
05/12/2015 21:54 BeginnerDO#3
Is this what you are looking for? :)

Code:
Point center = new Point(My.Computer.Screen.WorkingArea.Width / 2, My.Computer.Screen.WorkingArea.Height / 2);
05/12/2015 22:11 Biesi#4
To get distances in two-dimensional space you can use the following formula

[Only registered and activated users can see links. Click Here To Register...]
05/18/2015 00:03 Epanias#5
Quote:
Originally Posted by BeginnerDO View Post
Is this what you are looking for? :)

Code:
Point center = new Point(My.Computer.Screen.WorkingArea.Width / 2, My.Computer.Screen.WorkingArea.Height / 2);
[Only registered and activated users can see links. Click Here To Register...]

Just in case you're not common to the vb usage in c# ;).