private void PopulatePresets() { PresetInfo info; ComboBox.ObjectCollection items = cbPresets.Items; info = new PresetInfo("Blinds", "(rint(4*x-y*2) % 2) - x", "(abs(x+2*y) % 0.75)*10+y/5", "rint(sin(sqrt(x*x+y*y))*3/5)+x/3"); items.Add(info); info = new PresetInfo("Bullseye", "1-rint(x/y*0.5)", "1-rint(y/x*0.4)", "rint(sin(sqrt(x*x+y*y)*10))"); items.Add(info); info = new PresetInfo("Wave", "cos(x/2)/2", "cos(y/2)/3", "rint(sin(sqrt(x*x*x+y*y)*10))"); items.Add(info); info = new PresetInfo("Swirls", "x*15", "cos(x*y*4900)", "y*15"); items.Add(info); info = new PresetInfo("Mod", "(x ^2) % y", "y % x", "x % y"); items.Add(info); info = new PresetInfo("Simple", "x", "y", "x+y"); items.Add(info); cbPresets.SelectedIndex = 0; }
private void cbPresets_SelectedIndexChanged(object sender, EventArgs e) { PresetInfo preset = (PresetInfo)cbPresets.SelectedItem; this.tbRed.Text = preset.MyRed; this.tbGreen.Text = preset.MyGreen; this.tbBlue.Text = preset.MyBlue; this.btnGenerate.Enabled = true; this.tbRed.BackColor = Color.Empty; this.tbGreen.BackColor = Color.Empty; this.tbBlue.BackColor = Color.Empty; }