public void GetYshenBig(out int witdh, out int height) { IntPtr hd = _GetBoardHandle(); APIHelper.RECT rect = new APIHelper.RECT(); APIHelper.GetWindowRect(hd, out rect); witdh = rect.Right - rect.Left; height = rect.Bottom - rect.Top; }
public Point GetMouseRelativePos() { Point p = new Point(); IntPtr hd = _GetBoardHandle(); APIHelper.RECT rect = new APIHelper.RECT(); APIHelper.GetWindowRect(hd, out rect); APIHelper.GetCursorPos(out p); p.X -= rect.Left; p.Y -= rect.Top; return(p); }
public Color GetPixColor(int x, int y) { IntPtr hd = _GetBoardHandle(); APIHelper.RECT rect = new APIHelper.RECT(); APIHelper.GetWindowRect(hd, out rect); x += rect.Left; y += rect.Top; IntPtr ptr_dc = Helpers.APIHelper.GetDC(IntPtr.Zero); int cl = Helpers.APIHelper.GetPixel(ptr_dc, x, y); Color rt = Color.FromArgb ( cl & 0x000000FF, (cl & 0x0000FF00) >> 8, (cl & 0x00FF0000) >> 16 ); return(rt); }