void button1_Click(object sender, EventArgs e) { bool wasPaused = paused; paused = true; if (ofd.ShowDialog() == DialogResult.OK) { SelectImage(ofd.FileName, ofd.SafeFileName); Pause(); genetic = new Genetic(targetBmp, set); } paused = wasPaused; }
public Form1() { InitializeComponent(); this.DoubleBuffered = true; this.FormBorderStyle = FormBorderStyle.FixedDialog; paused = true; SelectImage("Mona.png", "Mona.png"); set = new Settings(); genetic = new Genetic(targetBmp, set); formUpdateTimer = new Timer(); formUpdateTimer.Interval = 1; formUpdateTimer.Tick += UpdateForm; formUpdateTimer.Start(); formUpdateTimer.Enabled = false; }