Ejemplo n.º 1
0
 /// <summary>
 /// 放大镜
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Magnifier_Click(object sender, RoutedEventArgs e)
 {
     if (this.ImsMap == null)
     {
         return;
     }
     ImsMap.OperType = IMSOperType.None;
     if (this.magnifier == null)
     {
         this.magnifier = new Magnifier()
         {
             MapContainer = ImsMap
         };
         this.ImsMap.AddChildAt(this.magnifier, 1000);
     }
     else
     {
         if (this.ImsMap.Contains(this.magnifier))
         {
             this.ImsMap.RemoveChild(this.magnifier);
         }
         else
         {
             this.magnifier = new Magnifier();
             this.ImsMap.AddChildAt(this.magnifier, 1000);
         }
     }
 }
Ejemplo n.º 2
0
        public OverlayEyeNew(Configuration configuration, Point startPoint)
        {
            InitializeComponent();
            mConfiguration = configuration;

            FormBorderStyle = FormBorderStyle.None;
            ShowInTaskbar   = mConfiguration.ShowInTaskbar;
            //TopMost = mConfiguration.TopMostWindow;

            Width  = Screen.PrimaryScreen.Bounds.Width;
            Height = Screen.PrimaryScreen.Bounds.Height;

            this.DoubleBuffered = true;

            this.KeyDown   += new KeyEventHandler(HandleEsc);
            FormBorderStyle = FormBorderStyle.None;

            mTimer          = new Timer();
            mTimer.Enabled  = true;
            mTimer.Tick    += new EventHandler(HandleTimer);
            mTimer.Interval = 80;
            mTimer.Start();


            mStartPoint  = startPoint;
            mTargetPoint = startPoint;

            Magnifier mg = new Magnifier(this, mConfiguration);
        }
Ejemplo n.º 3
0
 private void startMagnifier()
 {
     if (magnifierButton.Checked)
     {
         if (Properties.Settings.Default.isLens)
         {
             magnifierWindowLens = new magnifier(Properties.Settings.Default.isLens);
             magnifierWindowLens.Show();
             mgnLens = new Karna.Magnification.Magnifier(magnifierWindowLens, Properties.Settings.Default.isLens);
             magnifierWindowLens.FormClosing += uncheckMagnifier;
             mgnLens.Magnification            = (float)(Properties.Settings.Default.magnificationRate + 2.0) / 2;
         }
         else
         {
             magnifierWindowDocked = new magnifier(Properties.Settings.Default.isLens);
             magnifierWindowDocked.Show();
             mgnDocked = new Magnifier(magnifierWindowDocked, Properties.Settings.Default.isLens);
             magnifierWindowDocked.FormClosing += uncheckMagnifier;
             mgnDocked.Magnification            = (float)(Properties.Settings.Default.magnificationRate + 2.0) / 2;
         }
     }
     else
     {
         if (magnifierWindowLens != null && !magnifierWindowLens.IsDisposed)
         {
             magnifierWindowLens.Close();
             magnifierWindowLens.Dispose();
         }
         if (magnifierWindowDocked != null && !magnifierWindowDocked.IsDisposed)
         {
             magnifierWindowDocked.Close();
             magnifierWindowDocked.Dispose();
         }
     }
 }
Ejemplo n.º 4
0
        public Form1()
        {
            InitializeComponent();
            overlay o = new overlay();

            o.Show();

            m = new Magnifier(this, o);
        }
 public WinzoomForm(Winzoom winz)
 {
     InitializeComponent();
     mag      = new Magnifier(this, ref magnification);
     Load    += new EventHandler(WinzoomForm_Load);
     KeyDown += new KeyEventHandler(WinzoomForm_KeyDown);
     wz       = winz;
     //FormBorderStyle = FormBorderStyle.None;
 }
Ejemplo n.º 6
0
 void zoomPicBox1_MouseMove(object sender, MouseEventArgs e)
 {
     Magnifier.MagnifierZoomImage(e.Location);
     labelX.Text    = zoomPicBox1.CurrentState.GetX();
     labelY.Text    = zoomPicBox1.CurrentState.GetY();
     labelR.Text    = zoomPicBox1.CurrentState.GetR();
     labelG.Text    = zoomPicBox1.CurrentState.GetG();
     labelB.Text    = zoomPicBox1.CurrentState.GetB();
     labelZoom.Text = zoomPicBox1.GetCurrentZoom().ToString();
     groupBox1.Refresh();
 }
Ejemplo n.º 7
0
        private void PageViewer_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            //manage the magnifier
            if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Mouse.LeftButton == MouseButtonState.Pressed)
            {
                Magnifier.Update(Mouse.GetPosition(PageViewerGrid));
                Magnifier.Visibility = Visibility.Visible;

                this.PageViewer.CaptureMouse();
                e.Handled = true;
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// update the magnifier
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PageViewer_PreviewMouseMove(object sender, MouseEventArgs e)
 {
     //manage the magnifier
     if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
     {
         if (Magnifier.Visibility == System.Windows.Visibility.Visible)
         {
             Magnifier.Update(Mouse.GetPosition(PageViewerGrid));
         }
         e.Handled = true;
     }
 }
Ejemplo n.º 9
0
        public NoMouse(Form context)
        {
            this.context = context;

            state = new TobiiMouseState(Screen.PrimaryScreen.Bounds);
            state.reset();

            magnifierForm = new Form();
            magnifierForm.FormBorderStyle = FormBorderStyle.None;
            magnifierForm.Visible         = false;
            magnifierForm.Size            = MAGNIFIER_WINDOW_SIZE;
            magnifier = new Magnifier(magnifierForm, MAGNIFIER_MAGNIFICATION);
        }
Ejemplo n.º 10
0
    /// <summary>
    /// Handles Page's PreRenderComplete.
    /// </summary>
    protected void Page_PreRenderComplete(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // add separator between each task in task menu

            Map map = Map1;


            // Remove the overview toggle it overviewmap doesn't exist, and identify if none of the resources support it.
            OverviewMap ov               = Page.FindControl("OverviewMap1") as OverviewMap;
            Magnifier   magnifier        = Page.FindControl("Magnifier1") as Magnifier;
            bool        supportsIdentify = true;
            bool        canMeasure       = true;
            //if (Measure1.MapUnits == MapUnit.Resource_Default)
            //    canMeasure = Measure1.CanGetUnits();
            Toolbar tb = Page.FindControl("Toolbar1") as Toolbar;
            if (tb != null)
            {
                for (int t = tb.ToolbarItems.Count - 1; t >= 0; t--)
                {
                    ToolbarItem item = tb.ToolbarItems[t];
                    if (item.Name == "OverviewMapToggle" && ov == null)
                    {
                        tb.ToolbarItems.Remove(item);
                    }
                    if (item.Name == "MapIdentify" && !supportsIdentify)
                    {
                        tb.ToolbarItems.Remove(item);
                    }
                    if (item.Name == "Measure" && !canMeasure)
                    {
                        tb.ToolbarItems.Remove(item);
                    }
                    if (item.Name == "Magnifier" && magnifier == null)
                    {
                        tb.ToolbarItems.Remove(item);
                    }
                }
            }
        }
    }
Ejemplo n.º 11
0
        private static void startMagnifier()
        {
            if (magnifierWindowLens == null)
            {
                magnifierWindowLens = new magnifier(true);
                magnifierWindowLens.Show();
                mgnLens = new Karna.Magnification.Magnifier(magnifierWindowLens, true);
                mgnLens.Magnification = (float)(Properties.Settings.Default.magnificationRate + 2.0) / 2;
            }

            /* else if(magnifierWindowDocked==null)
             * {
             *   //System.Windows.MessageBox.Show("This is Docked");
             *   magnifierWindowDocked = new magnifier(Properties.Settings.Default.isLens);
             *   magnifierWindowDocked.Show();
             *   mgnDocked = new Magnifier(magnifierWindowDocked, Properties.Settings.Default.isLens);
             *   mgnDocked.Magnification = (float)(Properties.Settings.Default.magnificationRate + 2.0) / 2;
             * }
             */
        }
Ejemplo n.º 12
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MessageBox.Show("R6 Siege Zoom Tool v1.1 By TasmeTime ;)");
            //Setting The Hotkeys
            m_GlobalHook = Hook.GlobalEvents();
            m_GlobalHook.MouseDownExt += M_GlobalHook_MouseDownExt;
            m_GlobalHook.MouseUpExt   += M_GlobalHook_MouseUpExt;
            m_GlobalHook.KeyDown      += M_GlobalHook_KeyDown;
            m_GlobalHook.KeyPress     += M_GlobalHook_KeyPress;

            //Rounding Form
            this.FormBorderStyle = FormBorderStyle.None;
            this.Location        = new Point((Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2);
            Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 1000, 1000));

            //Starting The Magnifier
            if (MagInitialize())
            {
                m = new Magnifier(this);
                m.Magnification = 1f;
            }
        }
 private void Magnifier_Click(object sender, RoutedEventArgs e)
 {
     if (this.MapContainer == null)
     {
         return;
     }
     if (this.m_magnifier == null)
     {
         this.m_magnifier = new Magnifier();
         this.MapContainer.AddChildAt(this.m_magnifier, 1000);
     }
     else
     {
         if (this.MapContainer.Contains(this.m_magnifier))
         {
             this.MapContainer.RemoveChild(this.m_magnifier);
         }
         else
         {
             this.m_magnifier = new Magnifier();
             this.MapContainer.AddChildAt(this.m_magnifier, 1000);
         }
     }
 }
Ejemplo n.º 14
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Magnifier magnifier = new Magnifier(this);
     //magnifier.UpdateMaginifier();
 }
Ejemplo n.º 15
0
        public ZoomWindow()
        {
            _magnifier = new Magnifier();

            InitializeComponent();
        }