Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.ShowDialog();
            if (ofd.FileName.Length > 0)
            {
                string path = ofd.FileName;

                VideoUtil myMpeg   = new VideoUtil(path);
                TimeSpan  currTime = new TimeSpan(10000000);
                TimeSpan  step     = new TimeSpan(10000000);
                Image     img      = null;
                for (int i = 0; i < 1000; i++)
                {
                    if (isClosingForm)
                    {
                        break;
                    }
                    Application.DoEvents();

                    img = myMpeg.CatchImage(currTime);
                    if (null != img)
                    {
                        label1.Text       = currTime.ToString("t");
                        pictureBox1.Image = img;
                        pictureBox1.Refresh();
                    }
                    currTime += step;
                }
            }
        }