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(); } }
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"; } }
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); } }
private void bntContinue_Click(object sender, EventArgs e) { webcam.Continue(); }
private void btnContinue_Click(object sender, RoutedEventArgs e) { _timer.Start(); web.Continue(); }