예제 #1
0
 //
 //This is the handler when the selected index changed in
 //the listbox
 //
 private void sicListBox(object o, EventArgs e)
 {
     try
     {
         CloseInterfaces();
         InitInterfaces();
         LoadFile(movieDir + movieFiles.Text);
         _fileName   = movieDir + movieFiles.Text;
         _grabFrames = new GrabFrames(_fileName);
         if (_grabFrames != null)
         {
             tmrNextFrame.Enabled                  = false;
             this.btnSave.Enabled                  = false;
             this.btnVideoPlay.Enabled             = false;
             this.btnVideoStop.Enabled             = false;
             this.btnVideoSave.Enabled             = false;
             this.progressPanel1.ProgressBar.Value = 0;
             this.progressPanel1.LabelInfo.Text    = "正在加载帧图,请稍等......";
             this.progressPanel1.IsVisible(true);
             _grabFrames.ReportProgressHandler += ReportProgressHandler;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error during playback, the application will terminate"
                         + "\\nMessage: " + ex.Message);
         Application.Exit();
     }
 }
예제 #2
0
 public SaveVideo(GrabFrames grabFrames, AviManager aviManager)
 {
     this._grabFrames = grabFrames;
     this._aviManager = aviManager;
     this._aviStream  = aviManager.AddVideoStream(false, this._grabFrames.MediaInfo.FPS, (Bitmap)this._grabFrames.Frames[0].Image);
 }