//----------------------------------------------------------------- //Functions to Background worker private void LoadFramesProcess(BackgroundWorker worker) { Frames = new LoadFrames(loadPathName); Frames.CreateTmp(temporaryFilesPath); this.framesAmount = Frames.FrameCount; for (int frameNumber = firstFrame; frameNumber <= Frames.FrameCount; frameNumber++) { Frames.Load(); int progressCalculated = CalculateProgress.Calculate(frameNumber, framesAmount); worker.ReportProgress(progressCalculated); } width = Frames.Width; height = Frames.Height; frameRate = Frames.FrameRate; Frames.Close(); }
private void MakeVideoProcess(BackgroundWorker worker) { SaveFrames file = new SaveFrames( savePathName, frameRate, width, height, temporaryFilesPath, bitRate); for (int frameNumber = firstFrame; frameNumber <= framesAmount; frameNumber++) { file.AddFrame(frameNumber); int progressCalculated = CalculateProgress.Calculate(frameNumber, framesAmount); worker.ReportProgress(progressCalculated); file.RemoveFile(frameNumber); } file.Close(); }
private void MakeCensorProcess(BackgroundWorker worker) { Selections lastSelection = censoredSelections[censoredSelections.Count - 1]; for (int actualSelection = lastSelection.BeginSelection; actualSelection <= lastSelection.EndSelection; actualSelection++) { ModifyImage modification = new ModifyImage(actualSelection, lastSelection, false); modification.pixelateSize = pixelate; modification.StartModification(); if (PassException.exceptionThrown != null) { break; } int framesAmount = lastSelection.EndSelection - lastSelection.BeginSelection; int frameNumber = actualSelection - lastSelection.BeginSelection; int progressCalculated = CalculateProgress.Calculate(frameNumber, framesAmount); worker.ReportProgress(progressCalculated); } }