public void ReplaceColoursWithPatterns(PatternEditor patterns) { mPatterns = patterns.GetPatterns(); Bitmap saved = new Bitmap(mOutput); ProgressBarForm prog = new ProgressBarForm("Replacing Colours With Patterns..."); prog.StartWorker(ReplaceColoursWithPatterns, this); if (prog.DialogResult != System.Windows.Forms.DialogResult.OK) { mOutput = saved; } }