Пример #1
0
        public static ScreenRegionForm Show(Rectangle captureRectangle, Action stopRequested, bool activateWindow, float duration = 0)
        {
            ScreenRegionForm regionForm = new ScreenRegionForm(captureRectangle, activateWindow);

            Thread thread = new Thread(() =>
            {
                regionForm.StopRequested += stopRequested;
                regionForm.UpdateTimer();
                regionForm.ShowDialog();
            });

            thread.Start();

            return(regionForm);
        }
Пример #2
0
        public static ScreenRegionForm Show(Rectangle captureRectangle, Action stopRequested, float duration = 0)
        {
            ScreenRegionForm regionForm = new ScreenRegionForm(captureRectangle);

            regionForm.StopRequested += stopRequested;

            if (duration > 0)
            {
                regionForm.IsCountdown = true;
                regionForm.Countdown   = TimeSpan.FromSeconds(duration);
            }

            regionForm.UpdateTimer();
            regionForm.Show();
            return(regionForm);
        }
Пример #3
0
        public static ScreenRegionForm Show(Rectangle captureRectangle, Action stopRequested, float duration = 0)
        {
            if (captureRectangle != CaptureHelpers.GetScreenBounds())
            {
                ScreenRegionForm regionForm = new ScreenRegionForm(captureRectangle);
                regionForm.StopRequested += stopRequested;
                if (duration > 0)
                {
                    regionForm.IsCountdown = true;
                    regionForm.Countdown = TimeSpan.FromSeconds(duration);
                }
                regionForm.UpdateTimer();
                regionForm.Show();
                return regionForm;
            }

            return null;
        }
Пример #4
0
        public static ScreenRegionForm Show(Rectangle captureRectangle, Action stopRequested, bool activateWindow, float duration = 0)
        {
            ScreenRegionForm regionForm = new ScreenRegionForm(captureRectangle, activateWindow);

            Thread thread = new Thread(() =>
            {
                regionForm.StopRequested += stopRequested;
                regionForm.UpdateTimer();
                regionForm.ShowDialog();
            });

            thread.Start();

            return regionForm;
        }
        public static ScreenRegionForm Show(Rectangle captureRectangle, Action stopRequested, float duration = 0)
        {
            ScreenRegionForm regionForm = new ScreenRegionForm(captureRectangle);

            Thread thread = new Thread(() =>
            {
                regionForm.StopRequested += stopRequested;

                if (duration > 0)
                {
                    regionForm.IsCountdown = true;
                    regionForm.Countdown = TimeSpan.FromSeconds(duration);
                }

                regionForm.UpdateTimer();
                regionForm.ShowDialog();
            });

            thread.Start();

            return regionForm;
        }