private void QuitButton_Click(object sender, EventArgs e) { if (mode == RunMode.ReadingFrames) { if (sourceSession != null) { sourceSession.Dispose(); } } Application.Exit(); }
// Display the next frame in the AVI file private void timer1_Tick(object sender, EventArgs e) { // End of AVI? if (curFrame >= session.Frames) { session.Dispose(); Application.Exit(); return; } // Read the frame session.ReadFrame(imageViewer1.Image, curFrame); progressBar1.Value = (int)curFrame; // Increment frame curFrame++; }