Пример #1
0
        public void TestFullScreenScreenshot()
        {
            CommandLineArguments args = new CommandLineArguments(new string[] { "testshot.png" });
            ScreenShotMaker      foo  = new ScreenShotMaker(args);

            foo.Run();
        }
Пример #2
0
        static int Main(string[] args)
        {
            ApplicationScope applicationScope = new ApplicationScope(args);
            ScreenShotMaker  screenShooter    = ScreenshooterInjector.CreateScreenShotMaker(applicationScope);
            int exitCode = screenShooter.Run();

            return(exitCode);
        }
Пример #3
0
        public void OneTimeSetUp()
        {
            driver = new ChromeDriver();
            wait   = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            driver.Manage().Window.Maximize();

            baseURL = "https://perf.exalinkservices.com";
            driver.Navigate().GoToUrl(baseURL);

            ScreenShotMakerInstance = new ScreenShotMaker(driver);

            Pages = new PageObjectsList(driver);

            Pages.LoginPageInstance.SingIn(username, password);
            wait.Until((d) => Pages.ProjectsPageInstance.IsProjectPageDisplayed());
            Pages.HeaderNavigationInstance.SelectClient(x_client);
        }
Пример #4
0
        private void Window_PreviewMouseMove(object sender, MouseEventArgs e)
        {
            if (isMouseDown)
            {
                double curx = e.GetPosition(null).X;
                double cury = e.GetPosition(null).Y;

                System.Windows.Shapes.Rectangle r = new System.Windows.Shapes.Rectangle
                {
                    Stroke          = System.Windows.Media.Brushes.White,
                    Fill            = System.Windows.Media.Brushes.White,
                    StrokeThickness = 1,
                    Width           = Math.Abs(curx - x),
                    Height          = Math.Abs(cury - y)
                };

                cnv.Children.Clear();
                cnv.Children.Add(r);
                Canvas.SetLeft(r, Math.Min(x, curx));
                Canvas.SetTop(r, Math.Min(y, cury));

                if (e.LeftButton == MouseButtonState.Released)
                {
                    cnv.Children.Clear();
                    Hide();
                    width  = Math.Abs(curx - x);
                    height = Math.Abs(cury - y);

                    bitmap = ScreenShotMaker.CaptureScreen(width, height, Math.Min(x, curx) - 7, Math.Min(y, cury) - 7);

                    x           = y = 0;
                    isMouseDown = false;
                    Close();
                }
            }
        }