示例#1
0
        public void Show()
        {
            if (Mag == null)
            {
                Mag    = new MagnifierForm();
                Window = new MagnifyingCursor(this);

                Settings.Listener.PropertyChanged += Listener_PropertyChanged;
                Settings.Listener.SettingChanged  += Listener_SettingChanged;
                Listener_SettingChanged(null, Settings.Current);
            }

            var scr = InputService.Current.TargetScreen.Bounds;

            Mag.Form.Width  = scr.Width;
            Mag.Form.Height = scr.Height;
            Mag.Form.Top    = scr.Top;
            Mag.Form.Left   = scr.Left;
            Mag.Show();

            Window.Left = InputService.Current.Cursor.Window.Left;
            Window.Top  = InputService.Current.Cursor.Window.Top;
            Window.Show();

            Mag.Magnifier.UpdateMaginifier();
            if (moveUpdater == null)
            {
                moveUpdater = new Thread(() =>
                {
                    while (true)
                    {
                        MoveUpdater_Tick(null, null);
                        Thread.Sleep(10);
                    }
                });
                moveUpdater.IsBackground = true;
                moveUpdater.Name         = "MagUpdate";
            }
            moveUpdater.Start();

            var cursor = InputService.Current.Cursor;

            cursor.Window.Visibility = Visibility.Collapsed;
            cursor.GazeTracked      += Cursor_GazeTracked;
            cursor.Clicked          += Cursor_Clicked;
            cursor.Released         += Cursor_Released;

            InputService.Current.KeyboardStartupOption = KeyboardStartupOption.CenterCursor;
            InputService.Current.KeyboardSize          = 1.0 / Settings.Current.MagnifyFactor * 1.25;

            GlobalKeyHook.Hook.KeyboardPressed += Hook_KeyboardPressed;

            IsShowed = true;
        }
示例#2
0
        private void Magnifier_Button_Click(object sender, EventArgs e)
        {
            int x = mLastCursorPosition.X;
            int y = mLastCursorPosition.Y;

            mLastCursorPosition = Cursor.Position;
            //EyeXWarpPointer eyeXWarpPointer = new EyeXWarpPointer(mConfiguration);

            magnifierForm = new MagnifierForm(mConfiguration, mLastCursorPosition);
            magnifierForm.Show();
            magnifierFormIsShown = true;

            //this.Hide();
        }
示例#3
0
        public void Act(int index)
        {
            if (Auxiliary.SearchChild().listRegionRectangle.Count > index)
            {
                if (magnifierForm == null)
                {
                    var currentNumberObject = Auxiliary.SearchChild();

                    magnifierForm = new MagnifierForm();
                    magnifierForm.Show();

                    currentNumberObject.Magnifier = new Magnifier(magnifierForm, currentNumberObject.listRegionRectangle[index], currentNumberObject.GenerationNumber);
                }
            }
        }
示例#4
0
        public void Dispose()
        {
            if (IsShowed)
            {
                Close();
            }

            Mag?.Dispose();
            Mag = null;

            Window?.Close();
            Window = null;

            Settings.Listener.PropertyChanged -= Listener_PropertyChanged;
            Settings.Listener.SettingChanged  -= Listener_SettingChanged;
        }