private void button2_Click(object sender, EventArgs e) { int type = 0; if (radioButton1.Checked) { type = 0; } if (radioButton2.Checked) { type = 1; } if (radioButton3.Checked) { type = 2; } if (sourceImage != null) { imageBox2.Image = logic.chanelsChange(sourceImage, type); } }