/** @copydoc Layer::dispose */
        protected override void dispose()
        {
            base.dispose();

            lock (m_objSync)
            {
                if (m_webcam != null)
                {
                    m_webcam.Close();
                    m_webcam.Dispose();
                    m_webcam = null;
                    m_filter = null;
                }
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (wCam == null)
     {
         wCam = new WebCam {
             Container = pictureBox1
         };
         wCam.OpenConnection();
         timer1.Start();
         button1.Text = "Stop WebCam";
     }
     else
     {
         timer1.Stop();
         wCam.Dispose();
         wCam         = null;
         button1.Text = "Start WebCam";
     }
 }