Пример #1
0
        private Point limitToScreenBounds(Point p)
        {
            Rectangle screenSize = PrecisionGazeMouseForm.GetScreenSize();
            int       margin     = 10;

            if (p.X < margin)
            {
                p.X = margin;
            }
            if (p.Y < margin)
            {
                p.Y = margin;
            }
            if (p.X >= screenSize.Width - margin)
            {
                p.X = screenSize.Width - margin;
            }
            if (p.Y >= screenSize.Height - margin - 5)
            {
                p.Y = screenSize.Height - margin - 5;
            }

            return(p);
        }
Пример #2
0
        private Point getScreenCenter()
        {
            Rectangle screenSize = PrecisionGazeMouseForm.GetScreenSize();

            return(new Point(screenSize.Width / 2, screenSize.Height / 2));
        }