コード例 #1
0
ファイル: frmOptions.cs プロジェクト: Fraham/ScreenCapture
        /// <summary>
        /// Opens the form to allow the user to capture their desired area. It will then load the
        /// options back into the form again.
        /// </summary>
        private void DoUserCaptureArea(bool show)
        {
            /*
             * It will check if the form is already open, if so then it will dispose it.
             * It will open the form with the current options.
             */
            if (frmUCA != null)
            {
                frmUCA.Dispose();
                frmUCA = null;
            }

            frmUCA             = new frmUserCaptureArea(MakeOptions(), show);
            frmUCA.InstanceRef = this;

            this.Hide();
            Application.DoEvents();

            /*
             * If the response from the form is OK then it will get the options from user capture form and make sure that it is correct and then load them onto the form.
             */

            if (frmUCA.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                UsersOptions = frmUCA.CaptureOptions;

                if (UsersOptions.Width < ScreenSize.Width && UsersOptions.Height < ScreenSize.Height)
                {
                    UsersOptions.Fullscreen = false;
                }

                UsersOptions.SourcePoint = new Point(UsersOptions.SourcePoint.X + ScreenSize.TopLeftPoint.X, UsersOptions.SourcePoint.Y + ScreenSize.TopLeftPoint.Y);

                LoadOptions();
            }
        }
コード例 #2
0
ファイル: frmOptions.cs プロジェクト: haikieu/ScreenCapture
        /// <summary>
        /// Opens the form to allow the user to capture their desired area. It will then load the
        /// options back into the form again.
        /// </summary>
        private void DoUserCaptureArea(bool show)
        {
            /*
             * It will check if the form is already open, if so then it will dispose it.
             * It will open the form with the current options.
            */
            if (frmUCA != null)
            {
                frmUCA.Dispose();
                frmUCA = null;
            }

            frmUCA = new frmUserCaptureArea(MakeOptions(), show);
            frmUCA.InstanceRef = this;

            this.Hide();
            Application.DoEvents();

            /*
             * If the response from the form is OK then it will get the options from user capture form and make sure that it is correct and then load them onto the form.
             */

            if (frmUCA.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                UsersOptions = frmUCA.CaptureOptions;

                if (UsersOptions.Width < ScreenSize.Width && UsersOptions.Height < ScreenSize.Height)
                {
                    UsersOptions.Fullscreen = false;
                }

                UsersOptions.SourcePoint = new Point(UsersOptions.SourcePoint.X + ScreenSize.TopLeftPoint.X, UsersOptions.SourcePoint.Y + ScreenSize.TopLeftPoint.Y);

                LoadOptions();
            }
        }