Exemplo n.º 1
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     if (blRecording)
     {
         lblStatus.Text = "Stopped";
         screenCapture = null;
         blRecording = false;
     }
 }
Exemplo n.º 2
0
        private void startRecording()
        {
            Screen selectedScreen = null;

            string cmbScreen = lblStatus.Invoke(new GetTextCallback(getcmb1Text), new object[] { }) as string;

            foreach (Screen screen in lstScreens)
            {
                if (screen.DeviceName == cmbScreen)
                {
                    selectedScreen = screen;
                }
            }

            screenCapture = new ScreenCapture(Convert.ToInt32(txbFrameRate.Text), selectedScreen);

            float fltDelay = Convert.ToInt32(txbTime.Text);
            blCountDown = true;
            for (; fltDelay > 0; fltDelay -= 0.10f)
            {
                lblStatus.Invoke(new UpdateTextCallback(updateLblStatus), new string[] {"Waiting: " + Math.Round(fltDelay, 1).ToString(".0#")});
                Thread.Sleep(100);
            }
            lblStatus.Invoke(new UpdateTextCallback(updateLblStatus), new string[] { "Recording!" });
            blRecording = true;
            blCountDown = false;

            if (selectedScreen == null) {
                selectedScreen = lstScreens[0];
            }
        }