AnimatGuiCtrls.Video.AviPlayer.Run C# (CSharp) Method

Run() private method

Extract and display the frames
private Run ( ) : void
return void
        private void Run()
        {
            videoStream.GetFrameOpen();

            for (currentFrameIndex = 0; (currentFrameIndex < videoStream.CountFrames) && isRunning; currentFrameIndex++) {
                //show frame
                currentBitmap = videoStream.GetBitmap(currentFrameIndex);
                picDisplay.Invoke(new SimpleDelegate(SetDisplayPicture));
                picDisplay.Invoke(new SimpleDelegate(picDisplay.Refresh));

                //show position
                if (ctlFrameIndexFeedback != null) {
                    ctlFrameIndexFeedback.Invoke(new SimpleDelegate(SetLabelText));
                }

                //wait for the next frame
                Thread.Sleep(millisecondsPerFrame);
            }

            videoStream.GetFrameClose();
            isRunning = false;

            if (Stopped != null) {
                Stopped(this, EventArgs.Empty);
            }
        }