Esempio n. 1
0
 /// <summary>
 /// Get color at point.
 /// </summary>
 /// <param name="mousePoint">point</param>
 /// <param name="wantColor">want color</param>
 /// <param name="timeOut">timeOut</param>
 /// <param name="cancellationToken">cancellationToken</param>
 /// <returns>If wait unit time out, the return color is null.</returns>
 public async Task <bool> WaitColorNotAt(MouseApi.MousePoint mousePoint, Color wantColor,
                                         TimeSpan?timeOut = null, CancellationToken cancellationToken = default)
 {
     return(await WaitColorNotAt(new Point(mousePoint.X, mousePoint.Y), wantColor, timeOut, cancellationToken));
 }
Esempio n. 2
0
 /// <summary>
 /// Get mouse belong screen.
 /// </summary>
 /// <param name="point">Mouse point</param>
 /// <returns>Current screen contain mouse</returns>
 public Screen GetMouseScreen(MouseApi.MousePoint point)
 {
     return(Screen.AllScreens.FirstOrDefault(s => s.Bounds.Contains(new Point(point.X, point.Y))));
 }
Esempio n. 3
0
 /// <summary>
 /// Get color at point.
 /// </summary>
 /// <param name="mousePoint">point</param>
 /// <returns>color</returns>
 public Color GetColorAt(MouseApi.MousePoint mousePoint)
 {
     return(GetColorAt(new Point(mousePoint.X, mousePoint.Y)));
 }