Example #1
0
        //Recording function
        void StartRecording()
        {
            selfCapture = new ScreenCaptureJob();
            RECT selfRec;
            int  recordingType = Convert.ToInt32(Properties.Settings.Default["recordingType"]);

            if (recordingType == 0)
            {
                GetWindowRect(this.Handle, out selfRec);
                if (selfRec.Size.Width % 4 != 0 || selfRec.Size.Height % 4 != 0)
                {
                    selfRec.Width  = selfRec.Size.Width - selfRec.Size.Width % 4;
                    selfRec.Height = selfRec.Size.Height - selfRec.Size.Height % 4;
                }
            }

            else
            {
                Size rectArea = SystemInformation.WorkingArea.Size;
                selfRec = new RECT(0, 0, rectArea.Width - (rectArea.Width % 4), rectArea.Height - (rectArea.Height % 4));
            }

            selfCapture.CaptureRectangle     = selfRec;
            selfCapture.ShowFlashingBoundary = true;
            selfCapture.CaptureMouseCursor   = true;
            //selfCapture.ShowCountdown = true;
            selfCapture.OutputPath = Properties.Settings.Default["pictureLocation"].ToString();
            selfCapture.Start();
        }
 public void SetVideoOutputLocation(string testName = "")
 {
     try
     {
         screenCaptureJob = new ScreenCaptureJob();
         screenCaptureJob.CaptureRectangle = Screen.PrimaryScreen.Bounds;
         screenCaptureJob.ScreenCaptureVideoProfile.Force16Pixels = true;
         screenCaptureJob.ShowFlashingBoundary = true;
         screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = FrameRate;
         screenCaptureJob.CaptureMouseCursor = true;
         screenCaptureJob.ScreenCaptureVideoProfile.Quality = Quality;
         screenCaptureJob.ScreenCaptureVideoProfile.AutoFit = true;
         var path        = Assembly.GetCallingAssembly().CodeBase;
         var projectPath = new Uri(path.Substring(0, path.LastIndexOf("bin"))).LocalPath;
         resourcePath_VideoLocation = Path.Combine(projectPath, "VideoRecordings");
         if (string.IsNullOrEmpty(testName))
         {
             testName = "AutomationTest";
         }
         screenCaptureJob.OutputScreenCaptureFileName = Path.Combine(resourcePath_VideoLocation, string.Format("{0}{1}{2}", testName, DateTime.UtcNow.ToString("MMddyyyy_Hmm"), VideoExtension));
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error received : " + ex.Message + " - " + ex.StackTrace);
     }
 }
Example #3
0
        //Capture, Audio and encoder settings
        void StartCapturing(bool withAudio)
        {
            gotu = new ScreenCaptureJob();                                          // creat new job

            System.Drawing.Size FullScreen  = SystemInformation.PrimaryMonitorSize; // for full screen area
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;   // for working area = (full screen - Taskbar )
            Rectangle           captureRect;

            if (Properties.Settings.Default.CaptureRect == "Full Screen")
            {
                // captureRect = new Rectangle(0, 0, FullScreen.Width , FullScreen.Height); *** this line valid in Microsoft Expression Encoder 4 SP1 and invalid in SP2
                captureRect = new Rectangle(0, 0, FullScreen.Width - (FullScreen.Width % 4), FullScreen.Height - (FullScreen.Height % 4));
            }
            else
            {
                // captureRect = new Rectangle(0, 0, WorkingArea.Width , WorkingArea.Width); *** this line valid in Microsoft Expression Encoder 4 SP1 and invalid in SP2
                captureRect = new Rectangle(0, 0, WorkingArea.Width - (WorkingArea.Width % 4), WorkingArea.Height - (WorkingArea.Height % 4));
            }

            gotu.CaptureRectangle     = captureRect;
            gotu.ShowFlashingBoundary = Properties.Settings.Default.ShowFlashing;
            gotu.ScreenCaptureVideoProfile.FrameRate = Properties.Settings.Default.FrameRate;
            gotu.ScreenCaptureVideoProfile.Quality   = Properties.Settings.Default.Quality;
            gotu.CaptureMouseCursor = Properties.Settings.Default.CaptureMC;

            if (withAudio)
            {
                gotu.AddAudioDeviceSource(AudioDevices());
            }
            gotu.ShowCountdown = Properties.Settings.Default.ShowCountdown;
            gotu.OutputPath    = gotuOutput;
            gotu.Start();
        }
Example #4
0
        private void StartBtn_Click(object sender, RoutedEventArgs e)
        {
            if (!jobsc.Status.ToString().Equals("Running"))
            {
                System.IO.Directory.CreateDirectory(workDir);
                jobsc = new ScreenCaptureJob();
                jobsc.ScreenCaptureVideoProfile.FrameRate = 10;
                int width  = ((int)System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width) / 4;
                int height = ((int)System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height) / 4;
                width  = width * 4;
                height = height * 4;
                System.Drawing.Rectangle capRect = new System.Drawing.Rectangle(4, 0, width, height);  //iMacros billpc slides only
                jobsc.CaptureRectangle = capRect;

                var index       = 0;
                var fileCreated = false;
                do
                {
                    if (!File.Exists(workDir + "CurrentScreenCapture" + index + ".mp4"))
                    {
                        jobsc.OutputScreenCaptureFileName = workDir + "CurrentScreenCapture" + index + ".mp4";
                        fileCreated = true;
                    }
                    index++;
                } while (!fileCreated);
                jobsc.Start();
            }
        }
Example #5
0
        private void StartRecording()
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                buttonPauseResume.Enabled = true;
                progressBar1.Value        = 0;
                label1.Text = " ";

                buttonStartStop.Text = "Stop";


                job = new ScreenCaptureJob();

                Size workingArea = SystemInformation.WorkingArea.Size;
                //Size workingArea = SystemInformation.PrimaryMonitorSize; //Full Screen
                Rectangle captureRect = new Rectangle(0, 0, workingArea.Width - (workingArea.Width % 4), workingArea.Height - (workingArea.Height % 4));
                job.CaptureRectangle = captureRect;

                //Properties
                job.ScreenCaptureVideoProfile.FrameRate       = 60;
                job.ScreenCaptureVideoProfile.Quality         = 100;
                job.ScreenCaptureVideoProfile.SmoothStreaming = true;
                job.CaptureMouseCursor   = true;
                job.ShowCountdown        = true;
                job.ShowFlashingBoundary = true;

                job.AddAudioDeviceSource(AudioDevices());

                job.OutputPath = folderBrowserDialog1.SelectedPath + "\\";
                job.OutputScreenCaptureFileName = job.OutputPath + "ScreenCapture_" + DateTime.Today.ToString("MM-dd-yyyy ") + DateTime.Now.ToString("h.mm.ss tt") + ".xesc";

                job.Start();
            }
        }
 public void Setup()
 {
     const String pathname = @"..\..\autoConfig.xml";
     try
     {
        ClickPortalUI.AutoConfig.read(pathname);
        if (ClickPortalUI.AutoConfig.ContainsKey("EnableVideoRecording"))
         {
             _testScreenCaptureFileName = @"C:\TempLogs\VideoRecordings\" + TestContext.CurrentContext.Test.FullName + ".wmv";
             if (ClickPortalUI.AutoConfig["EnableVideoRecording"].ToLower() == "true")
             {
                 if (File.Exists(_testScreenCaptureFileName))
                 {
                     File.Delete(_testScreenCaptureFileName);
                 }
                 scj = new ScreenCaptureJob();
                 scj.OutputScreenCaptureFileName = _testScreenCaptureFileName;
                 scj.Start();
                 Trace.WriteLine(String.Format("Starting recording for test: {0}", TestContext.CurrentContext.Test.FullName));
             }
         }
         ClickPortalUI.Initialize();
         ((IJavaScriptExecutor)CCWebUIAuto.webDriver).ExecuteScript("window.showModalDialog = window.openWindow;");
         Trace.WriteLine(String.Format("Executing test: {0}", TestContext.CurrentContext.Test.FullName));
     }
     catch (Exception e)
     {
         ExceptionHandler.HandleException(e);
     }
 }
        public void Firefox_TearDown(IWebDriver driver, ILog log)
        {
            try
            {
                driver.Quit();

                this.job.Stop();

                this.job = null;

                log.Info("Test Completed" + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                log.Info("\n \n --------------------------------------------------------------------------------------------------------------------------------");
            }
            catch (Exception e)
            {
                log.Error(e.Message + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                log.Info("\n \n --------------------------------------------------------------------------------------------------------------------------------");

                Assert.AreEqual(true, false);

                this.job.Stop();
            }
        }
        public void Setup()
        {
            const String pathname = @"..\..\autoConfig.xml";

            try
            {
                ClickPortalUI.AutoConfig.read(pathname);
                if (ClickPortalUI.AutoConfig.ContainsKey("EnableVideoRecording"))
                {
                    _testScreenCaptureFileName = @"C:\TempLogs\VideoRecordings\" + TestContext.CurrentContext.Test.FullName + ".wmv";
                    if (ClickPortalUI.AutoConfig["EnableVideoRecording"].ToLower() == "true")
                    {
                        if (File.Exists(_testScreenCaptureFileName))
                        {
                            File.Delete(_testScreenCaptureFileName);
                        }
                        scj = new ScreenCaptureJob();
                        scj.OutputScreenCaptureFileName = _testScreenCaptureFileName;
                        scj.Start();
                        Trace.WriteLine(String.Format("Starting recording for test: {0}", TestContext.CurrentContext.Test.FullName));
                    }
                }
                ClickPortalUI.Initialize();
                ((IJavaScriptExecutor)CCWebUIAuto.webDriver).ExecuteScript("window.showModalDialog = window.openWindow;");
                Trace.WriteLine(String.Format("Executing test: {0}", TestContext.CurrentContext.Test.FullName));
            }
            catch (Exception e)
            {
                ExceptionHandler.HandleException(e);
            }
        }
Example #9
0
        public void Chrome_TearDown(IWebDriver driver, ILog log)
        {
            try
            {
                if (keepScreenShots == "yes")
                {
                    string testname = NUnit.Framework.TestContext.CurrentContext.Test.FullName;

                    // uf.TakeScreenshot(driver, "other", testname);

                    Thread.Sleep(2000);
                }

                driver.Quit();

                this.job.Stop();

                this.job = null;

                log.Info("Test Completed" + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                log.Info("\n \n --------------------------------------------------------------------------------------------------------------------------------");
            }
            catch (Exception e)
            {
                log.Error(e.Message + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                log.Info("\n \n --------------------------------------------------------------------------------------------------------------------------------");

                Assert.AreEqual(true, false);

                this.job.Stop();
            }
        }
        //Function which sets the recording are for the screen capture and begins the recording
        void startRecord()
        {
            screenCap = new ScreenCaptureJob();

            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           captureRect = new Rectangle(this.panel1.Location.X + 780, this.panel1.Location.Y + 330, this.panel1.Size.Width - 50, this.panel1.Size.Height - 170);

            screenCap.CaptureRectangle     = captureRect;
            screenCap.ShowFlashingBoundary = true;
            screenCap.ShowCountdown        = true;
            //screenCap.CaptureMouseCursor = true;
            //screenCap.AddAudioDeviceSource(AudioDevices());
            //screenCap.OutputPath = @"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist";

            if (File.Exists(@"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid))
            {
                File.Delete(@"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid);
                axWindowsMediaPlayer1.URL             = "";
                screenCap.OutputScreenCaptureFileName = @"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid;
                screenCap.Start();
            }
            else
            {
                screenCap.OutputScreenCaptureFileName = @"C:\Users\Connor Bates\Documents\Visual Studio 2015\Projects\SignAssist\Videos\Attempts\" + currDualVid;
                screenCap.Start();
            }
        }
Example #11
0
        public VideoRecorder()
        {
            FileName = GetFileName();

            _screenCaptureJob = new ScreenCaptureJob {
                OutputScreenCaptureFileName = FileName
            };
        }
 public void Start()
 {
     scj = new ScreenCaptureJob();
     if (File.Exists(OutputFile))
         File.Delete(OutputFile);
     scj.OutputScreenCaptureFileName = OutputFile;
     scj.Start();
 }
Example #13
0
        public void CaptureTestVideo()
        {
            ScreenCaptureJob scj = new ScreenCaptureJob();

            scj.OutputScreenCaptureFileName = @"C:\Users\Selina\source\repos\MassiveDynamic\Test.avi";
            scj.Start();
            Thread.Sleep(2000);
            scj.Stop();
        }
        private void StartButton_Click(object sender, System.EventArgs e)
        {
            stopButton.Enabled  = true;
            startButton.Enabled = false;

            InitializeScreenCaptureJob();

            ScreenCaptureJob.Start();
        }
        private void StopButton_Click(object sender, System.EventArgs e)
        {
            stopButton.Enabled  = false;
            startButton.Enabled = true;

            ScreenCaptureJob.Stop();

            ScreenCaptureJob.Dispose();
            ScreenCaptureJob = null;
        }
Example #16
0
 public void Start()
 {
     scj = new ScreenCaptureJob();
     if (File.Exists(OutputFile))
     {
         File.Delete(OutputFile);
     }
     scj.OutputScreenCaptureFileName = OutputFile;
     scj.Start();
 }
Example #17
0
 public static void StartRecordingVideo()
 {
     if (testEInfo.isRecording)
     {
         job = new ScreenCaptureJob();
         job.CaptureRectangle     = Screen.PrimaryScreen.Bounds;
         job.ShowFlashingBoundary = true;
         job.OutputPath           = AutomationLogging.newLocationInResultFolder;
         job.Start();
     }
 }
        public void TestMethod()
        {
            if (scriptRecording.Equals("true"))
            {
                scj = new ScreenCaptureJob();
                scj.OutputScreenCaptureFileName = "E:\\" + this.GetType().Name + ".avi";
                scj.Start();
            }

            Thread.Sleep(3000);
            scj.Stop();
        }
        public static ScreenCaptureJob CaptureRecording(Rectangle bounds, String savePath)
        {
            ScreenCaptureJob rcdJob = new ScreenCaptureJob();

            //Rectangle padded = new Rectangle(bounds.X, bounds.Y, bounds.Width - (bounds.Width % 4), bounds.Height - (bounds.Height % 4));

            rcdJob.CaptureRectangle   = new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height);
            rcdJob.CaptureMouseCursor = true;
            rcdJob.OutputPath         = savePath;
            rcdJob.Start();

            return(rcdJob);
        }
        private void startRecording()
        {
            job = new ScreenCaptureJob();
            System.Drawing.Size      workingArea = SystemInformation.WorkingArea.Size;
            System.Drawing.Rectangle captureRect = new System.Drawing.Rectangle(0, 0, workingArea.Width - (workingArea.Width % 4), workingArea.Height - (workingArea.Height % 4));
            job.CaptureRectangle = captureRect;

            job.ShowFlashingBoundary = true;
            job.ShowCountdown        = true;
            job.CaptureMouseCursor   = true;
            job.OutputPath           = @"D:/RecoreFolder";
            job.Start();
        }
Example #21
0
 private void StartRecording()
 {
     if (videoPath == null)
     {
         MessageBox.Show("Output path undefined!");
     }
     else
     {
         screenCaptureJob = new ScreenCaptureJob();
         SetRecordPreferences();
         screenCaptureJob.Start();
     }
 }
Example #22
0
        public void TestSetup()
        {
            // Create a instance of ScreenCaptureJob from Expression Encoder
            scj = new ScreenCaptureJob();

            // Specify the path & name of the file to which Encoder will store the recording.
            // Name of Test is passed to create individual recordings of each test
            scj.OutputScreenCaptureFileName = @"C:\Results\TestGooleSearch.wmv";

            // Start the Screen Capture Job
            scj.Start();

            driver = new FirefoxDriver();
        }
Example #23
0
        public void TestSetup()
        {
            // Create a instance of ScreenCaptureJob from Expression Encoder
            scj = new ScreenCaptureJob();

            // Specify the path & name of the file to which Encoder will store the recording.
            // Name of Test is passed to create individual recordings of each test
            scj.OutputScreenCaptureFileName = @"C:\Results\TestGooleSearch.wmv";

            // Start the Screen Capture Job
            scj.Start();

            driver = new FirefoxDriver();
        }
        public void Chrome_TearDown(IWebDriver driver, ILog log)
        {
            try
            {
                if (driver != null)
                {
                    Thread.Sleep(5000);
                }
                driver.Quit();

                if (recordEvidence == "yes")
                {
                    this.job.Stop();

                    this.job = null;
                }

                log.Info("Test Completed" + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                log.Info("\n \n --------------------------------------------------------------------------------------------------------------------------------");
            }
            catch (Exception e)
            {
                log.Error(e.Message + "\n" + e.StackTrace + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                log.Info("\n \n --------------------------------------------------------------------------------------------------------------------------------");

                this.job.Stop();

                Assert.AreEqual(true, false);
            }

            try
            {
                // This is to check if Sikuli setting is set to 'Yes' and then stop the launcher

                if (globList.ElementAt(0).ToString().ToLower().Equals("yes"))
                {
                    launcher.Stop();
                }
            }
            catch (Exception e)
            {
                Process[] proc = Process.GetProcessesByName("javaw");

                proc[0].Kill();

                log.Info("Javaw process killed");
            }
        }
Example #25
0
 private void Initialize()
 {
     this.screenCaptureJob = new ScreenCaptureJob();
     this.screenCaptureJob.CaptureRectangle = new Rectangle(0, 0, this.width, this.height);
     this.screenCaptureJob.ScreenCaptureVideoProfile.Force16Pixels = true;
     this.screenCaptureJob.ShowFlashingBoundary = true;
     this.screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = FrameRate;
     this.screenCaptureJob.CaptureMouseCursor = true;
     this.screenCaptureJob.ScreenCaptureVideoProfile.Quality = Quality;
     this.screenCaptureJob.ScreenCaptureVideoProfile.Size    = new Size(this.width, this.height);
     this.screenCaptureJob.ScreenCaptureVideoProfile.AutoFit = true;
     this.screenCaptureJob.OutputScreenCaptureFileName       = this.GetTempFilePathWithExtension();
     this.isDisposed = false;
 }
Example #26
0
        void StartRecord()
        {
            scr = new ScreenCaptureJob();

            Rectangle captureRect = new Rectangle(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);

            scr.CaptureRectangle     = captureRect;
            scr.ShowFlashingBoundary = true;
            scr.ShowCountdown        = true;
            scr.CaptureMouseCursor   = true;
            scr.ScreenCaptureVideoProfile.FrameRate = 72;
            scr.AddAudioDeviceSource(AudioDevices());
            scr.OutputPath = @"C:\M.T.A.L Studio";
            scr.Start();
        }
 /// <summary>
 /// Procedure that initiates video capture of the test.
 /// </summary>
 /// <param name="testCasename">Name of the test suite.</param>
 public void OptionalVideoCapture(string testCasename)
 {
     var strVideo = Browser.GetConfigValue("VIDEO").ToUpper();
     IsVideoEnabled = strVideo.ToUpper() == "YES";
     if (IsVideoEnabled)
     {
         Scj = new ScreenCaptureJob
         {
             OutputScreenCaptureFileName = Browser.GetConfigValue("TEST_RESULTS_FOLDER_PATH") +
                                           DateTime.Now.ToString("yyyy-dd-MM.hh.mm.ss") +
                                           "-" + testCasename + ".wmv"
         };
         Scj.Start();
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ScreenCaptureProvider"/> class.
        /// </summary>
        /// <param name="tempFolder">The temporary folder.</param>
        /// <param name="urlHelper">The URL helper.</param>
        /// <param name="embeddedResourceHelper"></param>
        /// <param name="azureBlobStorage">The azure BLOB storage.</param>
        /// <exception cref="System.IO.DirectoryNotFoundException"></exception>
        public ScreenCaptureProvider(string tempFolder, IUrlHelper urlHelper, IEmbeddedResourceHelper embeddedResourceHelper, IAzureBlobStorage azureBlobStorage)
        {
            _urlHelper = urlHelper;
            _embeddedResourceHelper = embeddedResourceHelper;
            _azureBlobStorage = azureBlobStorage;

            ScreenCaptureJob = new ScreenCaptureJob();
            if (tempFolder == null || !Directory.Exists(tempFolder))
            {
                throw new DirectoryNotFoundException(string.Format("Directory {0} not found", tempFolder));
            }

            OutputScreenCaptureFile = string.Format("{0}\\ScreenCapture.wmv", tempFolder);
            ScreenCaptureJob.OutputScreenCaptureFileName = OutputScreenCaptureFile;
        }
Example #29
0
        public string Chrome_Setup(IWebDriver driver, ILog log, IJavaScriptExecutor executor)
        {
            try
            {
                List <String> lstRecordEvidence = cf.readSysConfigFile("WebPortal", "Evidence", "SysConfig.xml");

                recordEvidence = lstRecordEvidence.ElementAt(1).ToString().ToLower();

                keepScreenShots = lstRecordEvidence.ElementAt(2).ToString().ToLower();

                if (recordEvidence == "yes")
                {
                    job = new ScreenCaptureJob();

                    string testname = NUnit.Framework.TestContext.CurrentContext.Test.FullName;

                    uf.ScreenCap(job, testname, driver);
                }

                screenHeight = uf.getScreenHeight(driver);                                          // Get screen Height

                screenWidth = uf.getScreenWidth(driver);

                log.Info("Screen Height:" + screenHeight + "Screen Width:" + screenWidth + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                driver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromSeconds(120));

                driver.Manage().Window.Position = new System.Drawing.Point(0, 0);

                driver.Manage().Window.Size = new Size(screenWidth, screenHeight);

                driver.Manage().Cookies.DeleteAllCookies();

                appURL = cf.readingXMLFile("WebPortal", "Login", "startURL", "Config.xml");

                driver.Navigate().GoToUrl(appURL);

                Thread.Sleep(2000);
            }
            catch (Exception e)
            {
                log.Error("Error occurred in Setup" + e.Message + " at line:" + new StackTrace(true).GetFrame(0).GetFileLineNumber());

                Assert.AreEqual(true, false);
            }

            return(appURL);
        }
Example #30
0
        //Call this method in setup method.
        public static void StartRecordingVideo()
        {
            //Provide setting in config file if you want to do recording or not.
            if (_isRecording)
            {
                _job = new ScreenCaptureJob();

                //job.CaptureRectangle = Screen.PrimaryScreen.Bounds;
                _job.ShowFlashingBoundary = true;

                //provide the location where you want to save the recording.
                _job.OutputPath = AutomationLogging.newLocationInResultFolder;

                _job.Start();
            }
        }
Example #31
0
        void StartRecording()
        {
            job = new ScreenCaptureJob();
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           CaptureRect = new Rectangle(0, 0, WorkingArea.Width - (WorkingArea.Width % 4), WorkingArea.Height - (WorkingArea.Height % 4));

            job.CaptureRectangle     = CaptureRect;
            job.ShowFlashingBoundary = true;
            job.ShowCountdown        = true;
            job.CaptureMouseCursor   = true;
            job.AddAudioDeviceSource(AudioDevices());
            job.OutputPath = Environment.CurrentDirectory;
            //job.OutputScreenCaptureFileName = fileScreenCaptureName;

            job.Start();
            //pictureBox1.Image = job.;
        }
        static void Main(string[] args)
        {
            ScreenCaptureJob job = new ScreenCaptureJob();

            // You can capture a window by setting its coordinates here
            job.CaptureRectangle = new Rectangle(100, 100, 200, 200);
            // Include the mouse pointer in the captured video
            job.CaptureMouseCursor = true;
            // Output file; you can transcode the xesc file to something else later.
            // Note that this silently does nothing if the file already exists.
            job.OutputScreenCaptureFileName = @"C:\Users\arx\scrcap\capture.xesc";
            // Do some capture
            job.Start();
            // Wait for a keypress
            Console.ReadKey();
            // And stop
            job.Stop();
        }
Example #33
0
        void StartRecord()

        {
            string str = string.Format(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos) +
                                       (@"\" + textBox1.Text));

            gotu = new ScreenCaptureJob();
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           captureRect = new Rectangle(0, 0, WorkingArea.Width, WorkingArea.Height);

            gotu.CaptureRectangle     = captureRect;
            gotu.ShowFlashingBoundary = true;
            gotu.ShowCountdown        = true;
            gotu.CaptureMouseCursor   = true;
            gotu.AddAudioDeviceSource(AudioDevices());
            gotu.OutputPath  = str;
            this.WindowState = FormWindowState.Minimized;
            System.Threading.Thread.Sleep(1000);
            gotu.Start();
        }
Example #34
0
        void StartRecord()
        {
            job = new ScreenCaptureJob();
            System.Drawing.Size WorkingArea = SystemInformation.WorkingArea.Size;
            Rectangle           captureRect = new Rectangle(0, 0, WorkingArea.Width, WorkingArea.Height);

            job.CaptureRectangle = captureRect;

            job.ShowFlashingBoundary = false;
            job.ShowCountdown        = false;
            job.CaptureMouseCursor   = false;
            job.OutputPath           = @"C:\Users\Public\Videos";
            job.ScreenCaptureVideoProfile.Quality = 95;
            var audioDevices = Microsoft.Expression.Encoder.Devices.EncoderDevices.FindDevices(Microsoft.Expression.Encoder.Devices.EncoderDeviceType.Audio);

            job.AddAudioDeviceSource(audioDevices.ElementAt(1));
            Microsoft.Expression.Encoder.Profiles.ConstantBitrate b = new Microsoft.Expression.Encoder.Profiles.ConstantBitrate(135000);
            job.ScreenCaptureVideoProfile.Bitrate   = b;
            job.ScreenCaptureVideoProfile.FrameRate = 25.0;
            job.Start();
        }
Example #35
0
        public static string StartRecordVideo()
        {
            _videorec = new ScreenCaptureJob {
                CaptureRectangle          = new Rectangle(0, 0, 1920, 1040),
                ScreenCaptureVideoProfile = { Quality = 20 },
                ShowFlashingBoundary      = false
            };

            string path      = Assembly.GetCallingAssembly().CodeBase;
            string finalPath = path.Substring(0, path.LastIndexOf("bin", StringComparison.Ordinal)) + "ErrorsVideos\\" +
                               TestContext.CurrentContext.Test.FullName + "_" +
                               DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss").Replace(':', '_') +
                               ".wmv";

            finalPath = finalPath.Replace("file:///", "").Replace("/", "\\");

            _videorec.OutputScreenCaptureFileName = finalPath;
            _videorec.Start();

            return(finalPath);
        }
 public void Start()
 {
     scj = new ScreenCaptureJob();
     scj.OutputScreenCaptureFileName = OutputFile;
     scj.Start();
 }