public CalibrationTobii(IEyeTracker eyeTracker, Configuration configuration, String calibrationMode)
        {
            InitializeComponent();
            this.KeyPreview = true;
            this.KeyDown   += new KeyEventHandler(HandleEsc);
            FormBorderStyle = FormBorderStyle.None;
            mEyeTracker     = eyeTracker;
            mConfiguration  = configuration;
            combineEyeGaze  = new combineEyes(mConfiguration);
            oneEyeRight     = new OneEyeRight(mConfiguration);
            oneEyeLeft      = new OneEyeLeft(mConfiguration);

            mCalibrationMode = calibrationMode;

            BufferedGraphicsContext context = BufferedGraphicsManager.Current;

            bufferedGraphics = context.Allocate(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height));
            Width            = Screen.PrimaryScreen.Bounds.Width;
            Height           = Screen.PrimaryScreen.Bounds.Height;

            FormBorderStyle = FormBorderStyle.None;

            timer.Enabled = true;
            // timer.Tick += new EventHandler(doCalibration);
            timer.Interval = 40; // 40 images per second.
            timer.Start();
        }
        public MagnifierWindowsBothEye(Form form, Configuration configuration, OverlayEyeNew overlayEyeNewForm, MouseController mController)
        {
            mConfiguration = configuration;

            hwndMag = form.Handle;

            if (form == null)
            {
                throw new ArgumentNullException("form");
            }

            magnification          = mConfiguration.ZoomFactor;
            this.overlayEyeNewForm = overlayEyeNewForm;
            //mTargetPoint = gazePoint;

            m_MAGFACTOR = mConfiguration.ZoomFactor;

            eyeXWarpPointer = new EyeXWarpPointer(mConfiguration);
            combineEyeGaze  = new combineEyes(mConfiguration);
            leftEyeGaze     = new OneEyeLeft(mConfiguration);
            rightEyeGaze    = new OneEyeRight(mConfiguration);

            controller = mController;


            this.form              = form;
            this.form.Resize      += new EventHandler(form_Resize);
            this.form.FormClosing += new FormClosingEventHandler(form_FormClosing);

            timer       = new Timer();
            timer.Tick += new EventHandler(timer_Tick);

            if (overlayEyeNewForm.fullScreen == false)  //if window mode
            {
                timer.Tick += new EventHandler(overlayEyeNewForm.HandleTimer);
            }

            initialized = NativeMethods.MagInitialize();


            if (initialized)
            {
                SetupMagnifier();
                timer.Interval = NativeMethods.USER_TIMER_MINIMUM;
                timer.Enabled  = true;
            }
        }
        public test(Configuration configuration, String userName, String savingPath, String testingMode)
        {
            InitializeComponent();

            Cursor.Hide();
            this.savingPath = savingPath;
            this.userName   = userName;

            this.mtestingMode = testingMode;

            this.KeyDown       += new KeyEventHandler(HandleEsc);
            this.drawGazePoints = false;

            mConfiguration = configuration;
            combineEyeGaze = new combineEyes(mConfiguration);
            oneEyeRight    = new OneEyeRight(mConfiguration);
            oneEyeLeft     = new OneEyeLeft(mConfiguration);

            mDelayFactor       = mConfiguration.delayFactor;
            mSensitivityOfTest = mConfiguration.sensitivityOfTest;


            FormBorderStyle  = FormBorderStyle.None;
            this.TopMost     = true;
            this.WindowState = FormWindowState.Maximized;

            BufferedGraphicsContext context = BufferedGraphicsManager.Current;

            context.MaximumBuffer = new Size(this.Width + 1, this.Height + 1);
            bufferedGraphics      = context.Allocate(this.CreateGraphics(), new Rectangle(0, 0, this.Width, this.Height));

            mScreenImage = new Bitmap(this.Width, this.Height);

            timer.Enabled  = true;
            timer.Tick    += new EventHandler(doTesting);
            timer.Interval = 40; // 40 images per second.
            timer.Start();
        }
        public MagnifierWindowRightEyeAndHead(Form form, Configuration configuration, OverlayEyeNew overlayEyeNewForm)
        {
            mConfiguration = configuration;

            if (form == null)
            {
                throw new ArgumentNullException("form");
            }

            headPoints = new EyeXPrecisionPointer(mConfiguration.senitivityOfHeadTracking);

            magnification          = mConfiguration.ZoomFactor;
            this.overlayEyeNewForm = overlayEyeNewForm;
            //mTargetPoint = gazePoint;

            m_MAGFACTOR = mConfiguration.ZoomFactor;

            rightEyeGaze = new OneEyeRight(mConfiguration);



            this.form              = form;
            this.form.Resize      += new EventHandler(form_Resize);
            this.form.FormClosing += new FormClosingEventHandler(form_FormClosing);

            timer       = new Timer();
            timer.Tick += new EventHandler(timer_Tick);
            timer.Tick += new EventHandler(overlayEyeNewForm.HandleTimer);

            initialized = NativeMethods.MagInitialize();

            if (initialized)
            {
                SetupMagnifier();
                timer.Interval = NativeMethods.USER_TIMER_MINIMUM;
                timer.Enabled  = true;
            }
        }