Пример #1
0
        // Zooms out.
        private void BZoomOut_Click(object sender, EventArgs e)
        {
            if (fractal == null)
            {
                return;
            }
            switch (zoom)
            {
            case 2:
                ChangeZoomSettings(1);
                BZoomIn.Text = "Zoom In (to 2x)";
                BZoomOut.Hide();
                BZoomIn.Show();
                break;

            case 3:
                ChangeZoomSettings(2);
                BZoomOut.Text = "Zoom Out (to 1x)";
                BZoomIn.Text  = "Zoom In (to 3x)";
                BZoomIn.Show();
                break;

            case 5:
                ChangeZoomSettings(3);
                BZoomOut.Text = "Zoom Out (to 2x)";
                BZoomIn.Text  = "Zoom In (to 5x)";
                BZoomIn.Show();
                break;

            default:
                throw new ArgumentException("Incorrect zoom.");
            }
            DrawFractal();
        }
Пример #2
0
 // Draws the fractal.
 private void BDrawFractal_Click(object sender, EventArgs e)
 {
     if (fractal == null)
     {
         MessageBox.Show("Please select a fractal to be drawn!", "No Fractal Selected");
         return;
     }
     zoom = 1;
     ChangeZoomSettings(1);
     BZoomOut.Hide();
     BZoomIn.Show();
     BZoomIn.Text = "Zoom In (to 2x)";
     DrawFractal();
 }
Пример #3
0
 /// <summary>
 /// Creates a new Form.
 /// </summary>
 public FFractalPainter()
 {
     InitializeComponent();
     MaximumSize = SystemInformation.PrimaryMonitorSize;
     MinimumSize = SystemInformation.PrimaryMonitorSize / 2;
     ChangeVisivilityOfCantorSetOptions(false);
     ChangeVisibilityOfPythagoreanTreeOptions(false);
     LRecursionDepth.Text       = "Recursion Depth: " + TBRecursionDepth.Value;
     LLineCoefficient.Text      = "Line Length Coefficient: " + TBLineCoefficient.Value / 100.0;
     LFirstAngle.Text           = "Left Branch Angle: " + TBFirstAngle.Value + "\u00B0";
     LSecondAngle.Text          = "Left Branch Angle: " + TBSecondAngle.Value + "\u00B0";
     LDistanceBetweenLines.Text = "Distance Between Lines: " + TBDistanceBetweenLines.Value;
     BFirstColour.BackColor     = firstColour;
     BSecondColour.BackColor    = secondColour;
     BZoomOut.Hide();
 }