예제 #1
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();
            }
        }
예제 #2
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();
        }
예제 #3
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();
        }
예제 #4
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.;
        }
예제 #5
0
        /// <summary>
        /// 开始录制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            screencapturejob.OutputPath = path;
            Collection <EncoderDevice> devices = EncoderDevices.FindDevices(EncoderDeviceType.Audio);//查询当前所有音频设备

            foreach (EncoderDevice device in devices)
            {
                try
                {
                    screencapturejob.AddAudioDeviceSource(device);//将音频设备的声音记录
                }
                catch {
                    //抛出其他异常的音频设备
                }
            }
            //录制开始
            screencapturejob.Start();
        }
예제 #6
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();
        }
예제 #7
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();
        }
예제 #8
0
        void StartRecord()
        {
            gotu = 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));

            gotu.CaptureRectangle     = captureRect;
            gotu.ShowFlashingBoundary = true;
            gotu.ShowCountdown        = true;
            gotu.CaptureMouseCursor   = true;
            gotu.AddAudioDeviceSource(AudioDevices());
            gotu.OutputPath = @"C:\Users\leo_n\Videos\video";

            try
            {
                gotu.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #9
0
        /// <summary>
        /// 开始录制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnStartJob_Click(object sender, EventArgs e)
        {
            SCJ.OutputPath = path;
            Collection <EncoderDevice> audioDevs = EncoderDevices.FindDevices(EncoderDeviceType.Audio);

            foreach (EncoderDevice device in audioDevs)
            {
                try
                {
                    SCJ.AddAudioDeviceSource(device);//记录声音
                }
                catch (Exception myerr)
                {
                    //设备异常
                }
            }

            //开始录制
            SCJ.Start();
            BtnStartJob.Enabled = false;
            BtnStopJob.Enabled  = true;
            //隐藏窗体
            this.Visible = false;
        }
예제 #10
0
        private void SetRecordPreferences()
        {
            audioDevices = EncoderDevices.FindDevices(EncoderDeviceType.Audio);

            if (microphoneSoundEnabled && !windowsSoundEnabled)
            {
                try
                {
                    for (int i = 0; i <= audioDevices.Count - 1; i++)
                    {
                        if (audioDevices[i].Category == EncoderDeviceCategory.Capture)
                        {
                            screenCaptureJob.AddAudioDeviceSource(audioDevices[i]);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }

            else if (!microphoneSoundEnabled && windowsSoundEnabled)
            {
                try
                {
                    for (int i = 0; i <= audioDevices.Count - 1; i++)
                    {
                        if (audioDevices[i].Category == EncoderDeviceCategory.Playback)
                        {
                            screenCaptureJob.AddAudioDeviceSource(audioDevices[i]);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            else if (microphoneSoundEnabled && windowsSoundEnabled)
            {
                try
                {
                    for (int i = 0; i <= audioDevices.Count - 1; i++)
                    {
                        if (audioDevices[i].Category == EncoderDeviceCategory.Capture || audioDevices[i].Category == EncoderDeviceCategory.Playback)
                        {
                            screenCaptureJob.AddAudioDeviceSource(audioDevices[i]);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }

            screenCaptureJob.ShowFlashingBoundary = true;
            screenCaptureJob.ShowCountdown        = true;
            screenCaptureJob.CaptureMouseCursor   = true;
            screenCaptureJob.OutputPath           = videoPath;

            workingArea       = SystemInformation.PrimaryMonitorSize;
            capturedRectangle = new Rectangle(0, 0, workingArea.Width, workingArea.Height);
            screenCaptureJob.CaptureRectangle = capturedRectangle;
        }