private async Task TxtYPos_KeyUpAsync(object sender, KeyEventArgs e) { var isXOK = int.TryParse(txtXPos.Text, out int x); var isYOK = int.TryParse(txtYPos.Text, out int y); if (isXOK && isYOK) { var color = MouseOperation.GetColorAt(new Point(x, y)); txtColor1.Text = color.Name; } }
private void M_GlobalHook_MouseMove(object sender, MouseEventArgs e) { if (_isStarted) { txtXPos.Text = e.Location.X.ToString(); txtYPos.Text = e.Location.Y.ToString(); txtColor1.Text = MouseOperation.GetColorAt(new Point { X = e.Location.X, Y = e.Location.Y }).Name; } }
private void BtnGetPosition_MouseUp(object sender, MouseEventArgs e) { var point = MouseOperation.GetCursorPosition(); txtXPos.Text = point.X.ToString(); txtYPos.Text = point.Y.ToString(); var color = MouseOperation.GetColorAt(point); txtColor1.Text = color.Name; Cursor.Current = Cursors.Default; }