/// <summary> /// When pictureBox redraws. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void pictureBox_Paint(object sender, PaintEventArgs e) { switch (pickedFractal) { case 0: koch = new KochCurve(depth, sender, e, p); koch.DrawFractal(p); break; case 1: triangle = new TriangleSerpinsky(depth, sender, e, p); triangle.DrawFractal(p); break; case 2: tree = new FractalTree(depth, sender, e, p); tree.LengthCoef = coef; tree.LeftAngle = leftAngle; tree.RightAngle = rightAngle; tree.DrawFractal(p); break; case 3: carpet = new CarpetSerpinskiy(depth, sender, e, p); carpet.DrawFractal(p); break; case 4: cantor = new CantorSet(depth, sender, e, p); cantor.SetDist(cantorDist); cantor.DrawFractal(p); break; } }