Exemplo n.º 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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
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;
        }