protected override void OnClosed(EventArgs e) { base.OnClosed(e); if (videoSource != null && videoSource.IsRunning) { videoSource.SignalToStop(); videoSource = null; } }
private void sair(object sender, EventArgs e) { if (videoSource != null && videoSource.IsRunning) { videoSource.SignalToStop(); videoSource = null; } this.Close(); }
public void tirar_foto(object sender, EventArgs e) { if (take.Text == "Save") { perfilPB.Image.Save("snapshot.png", System.Drawing.Imaging.ImageFormat.Png); videoSource.SignalToStop(); videoSource = null; perfilPB.ImageLocation = @".\snapshot.png"; perfilPB.SizeMode = PictureBoxSizeMode.Zoom; take.Text = "Tirar"; } else { take.Text = "Save"; Ini_tirar_foto(); } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { base.OnClosed(e); if (videoSource != null && videoSource.IsRunning) { videoSource.SignalToStop(); videoSource = null; } }
private void TakePicture_FormClosed(object sender, FormClosedEventArgs e) { base.OnClosed(e); if (videoSource != null && videoSource.IsRunning) { this.takenPicture.Dispose(); this.pictureBox1.Image.Dispose(); videoSource.SignalToStop(); videoSource = null; } }