コード例 #1
0
 private void LblWebCam_Click(object sender, EventArgs e)
 {
     try
     {
         if (lblWebCam.Text == "استفاده از WebCam")
         {
             wb.InitializeWebCam(ref picPerssonel);
             try
             {
                 wb.Start();
             }
             catch
             {
             }
             finally
             {
                 wb.Continue();
                 lblWebCam.Text = "عکس گرفتن";
             }
         }
         else if (lblWebCam.Text == "عکس گرفتن")
         {
             wb.Stop();
             lblWebCam.Text = "استفاده از WebCam";
             var image = picPerssonel.Image;
             var Name  = Guid.NewGuid().ToString() + ".jpg";
             var path  = Path.Combine(Application.StartupPath + "\\pictures\\Customer", Name);
             image.Save(path);
             Pic = Name;
         }
     }
     catch (Exception ex)
     {
         frmMessage f = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, ex.Message);
         f.ShowDialog();
     }
 }
コード例 #2
0
 private void btnWebCam_Click(object sender, EventArgs e)
 {
     if (btnWebCam.Text == "WebCam")
     {
         wb.InitializeWebCam(ref PictureBox);
         try
         {
             wb.Start();
         }
         catch
         {
         }
         finally
         {
             wb.Continue();
             btnWebCam.Text = "Capture";
         }
     }
     else if (btnWebCam.Text == "Capture")
     {
         wb.Stop();
         btnWebCam.Text = "WebCam";
     }
 }
コード例 #3
0
ファイル: Demo.cs プロジェクト: itcthienkhiem/LIS
        private void OnPlayWebCam()
        {
            try
            {
                btnStop.Enabled    = true;
                btnCapture.Enabled = true;
                btnPlay.Enabled    = false;

                if (!_isContinue)
                {
                    _webCam.Start();
                    _isContinue = true;
                }
                else
                {
                    _webCam.Continue();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.Text, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Utility.WriteToTraceLog(ex.Message);
            }
        }
コード例 #4
0
 private void bntContinue_Click(object sender, EventArgs e)
 {
     webcam.Continue();
 }
コード例 #5
0
 private void btnContinue_Click(object sender, RoutedEventArgs e)
 {
     _timer.Start();
     web.Continue();
 }