public MagnifierForm(Configuration configuration, Point startPoint) { InitializeComponent(); //--- My Init --- mConfiguration = configuration; FormBorderStyle = FormBorderStyle.None; ShowInTaskbar = mConfiguration.ShowInTaskbar; TopMost = mConfiguration.TopMostWindow; Width = mConfiguration.MagnifierWidth; Height = mConfiguration.MagnifierHeight; // Make the window (the form) circular GraphicsPath gp = new GraphicsPath(); gp.AddEllipse(ClientRectangle); Region = new Region(gp); mImageMagnifier = Properties.Resources.magnifierGlass; mTimer = new Timer(); mTimer.Enabled = true; mTimer.Interval = 20; mTimer.Tick += new EventHandler(HandleTimer); mScreenImage = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); mStartPoint = startPoint; mTargetPoint = startPoint; if (mConfiguration.ShowInTaskbar) ShowInTaskbar = true; else ShowInTaskbar = false; }
public ConfigurationForm(Configuration configuration) { InitializeComponent(); InitConfigutationSettings(configuration); }
private void InitConfigutationSettings(Configuration configuration) { mConfiguration = configuration; tb_ZoomFactor.Maximum = (int)Configuration.ZOOM_FACTOR_MAX; tb_ZoomFactor.Minimum = (int)Configuration.ZOOM_FACTOR_MIN; tb_ZoomFactor.Value = (int)mConfiguration.ZoomFactor; tb_SpeedFactor.Maximum = (int)(100 * Configuration.SPEED_FACTOR_MAX); tb_SpeedFactor.Minimum = (int)(100 * Configuration.SPEED_FACTOR_MIN); tb_SpeedFactor.Value = (int)(100 * mConfiguration.SpeedFactor); tb_Width.Maximum = 1000; tb_Width.Minimum = 100; tb_Width.Value = mConfiguration.MagnifierWidth; tb_Height.Maximum = 1000; tb_Height.Minimum = 100; tb_Height.Value = mConfiguration.MagnifierHeight; lbl_ZoomFactor.Text = mConfiguration.ZoomFactor.ToString(); lbl_SpeedFactor.Text = mConfiguration.SpeedFactor.ToString(); lbl_Width.Text = mConfiguration.MagnifierWidth.ToString(); lbl_Height.Text = mConfiguration.MagnifierHeight.ToString(); //--- Init Boolean Settings --- cb_CloseOnMouseUp.Checked = mConfiguration.CloseOnMouseUp; cb_DoubleBuffered.Checked = mConfiguration.DoubleBuffered; cb_HideMouseCursor.Checked = mConfiguration.HideMouseCursor; cb_RememberLastPoint.Checked = mConfiguration.RememberLastPoint; cb_ReturnToOrigin.Checked = mConfiguration.ReturnToOrigin; cb_ShowInTaskbar.Checked = mConfiguration.ShowInTaskbar; cb_TopMostWindow.Checked = mConfiguration.TopMostWindow; ShowInTaskbar = false; }
private void GetConfiguration() { try { mConfiguration = (Configuration)XmlUtility.Deserialize(mConfiguration.GetType(), mConfigFileName); } catch { mConfiguration = new Configuration(); } }