private void selectFilter_SelectedIndexChanged(object sender, EventArgs e) { if (Enum.GetNames(typeof(Filter)).Contains(selectFilter.SelectedItem.ToString()) && pictureBox1.Image != null) { filter.Progress += updateBar; filter.ApplyFilter((Filter)Enum.Parse(typeof(Filter), selectFilter.SelectedItem.ToString())); pictureBox1.Image = filter.FilteredImage; filter.Progress -= updateBar; } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { backend.ApplyFilter((Filter)comboBox1.SelectedIndex); backend.progressEvent += progressAchieved; pictureBox1.Image = (Image)backend.FilteredImage; }