Пример #1
0
        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;
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }