private void buttonRecalculate_Click(object sender, System.EventArgs e) { pictureBox.Image = new Bitmap(pictureBox.Width, pictureBox.Height); int heightstep = (int)(numericHeightstep.Value); int iterations = (int)(numericIterations.Value); int height = pictureBox.Height; int width = pictureBox.Width; landscapeGenerator.ResetPointList(width, height); landscapeGenerator.CalculateLandscape(iterations, heightstep); List <Point> points = landscapeGenerator.PointList; Graphics G = Graphics.FromImage(pictureBox.Image); using (var p = new Pen(Color.Blue, 4)) { for (int x = 0; x < points.Count - 1; x++) { G.DrawLine(p, points[x], points[x + 1]); } } pictureBox.Refresh(); }
private void buttonRecalculate_Click(object sender, System.EventArgs e) { backend.ResetPointList(pictureBox.Width, pictureBox.Height); //start waarde Points backend.CalculateLandscape(Convert.ToInt32(numericUDIterations.Value), Convert.ToInt32(numericUDHeightstep.Value)); drawIt(); }