private void SubmitClick(object sender, EventArgs e) { this.MidPointX = Convert.ToDouble(MidXText.Text); this.MidPointY = Convert.ToDouble(MidYText.Text); this.ScaleFactor = Double.Parse(ScaleText.Text); this.MaxLoop = int.Parse(MaxText.Text); //Refresh de image, dus opnieuw tekenen maar dan met andere values. MandelBrotImg.Refresh(); }
//Als je klikt wordt deze functie gedraait. Het middelpunt wordt aangepast en de schaalfactor gehalveerd void zoom(object sender, MouseEventArgs e) { ScaleText.Text = this.ScaleFactor.ToString(); MidPointX = Convert.ToDouble(e.X - MandelBrotSize.Width / 2) * this.ScaleFactor + MidPointX; MidPointY = Convert.ToDouble(e.Y - MandelBrotSize.Width / 2) * this.ScaleFactor + MidPointY; MidXText.Text = MidPointX.ToString(); MidYText.Text = MidPointY.ToString(); this.ScaleFactor = this.ScaleFactor * 0.5; MandelBrotImg.Refresh(); }
//Als user een keuze maakt in de list dan wordt deze functie gedraait private void ColorBoxSelectedIndexChanged(object sender, EventArgs e) { string selectedItem = ColorBox.GetItemText(ColorBox.SelectedItem); Console.WriteLine("lit" + selectedItem); //Points, maxloop en scalefactor per item in de itembox. switch (selectedItem) { case "default": this.ScaleFactor = 0.01; this.MidPointX = 0; this.MidPointY = 0; this.MaxLoop = 100; break; case "Abstract": this.ScaleFactor = 2.38418579101563E-09; this.MidPointX = -1.77067559719086; this.MidPointY = -0.0164487290382385; this.MaxLoop = 90; break; case "fancy": this.ScaleFactor = 2.98023223876954E-10; this.MidPointX = 0.255861408412457; this.MidPointY = -0.000638937056064606; this.MaxLoop = 1300; break; case "Kwadrant": this.ScaleFactor = 6.103515625E-07; this.MidPointX = -1.77066650390625; this.MidPointY = -0.0163330078125; this.MaxLoop = 100; break; } this.ColorMode = selectedItem; ScaleText.Text = this.ScaleFactor.ToString(); MidXText.Text = this.MidPointX.ToString(); MidYText.Text = this.MidPointY.ToString(); MaxText.Text = this.MaxLoop.ToString(); MandelBrotImg.Refresh(); }