Esempio n. 1
0
        private void GeneratePatternButton_Click(object sender, RoutedEventArgs e)
        {
            Int32.TryParse(IterationTextBox.Text, out int iterations);
            max = (iterations > 0) ? iterations : max;

            Double.TryParse(ZoomScaleTextBox.Text, out double zoom);
            this.zoom = (zoom != 0) ? zoom : this.zoom;

            Double.TryParse(CenterXTextBox.Text, out double XCenter);
            this.centerX = XCenter;

            Double.TryParse(CenterYTextBox.Text, out double YCenter);
            this.centerY = YCenter;

            UpdateLabels();

            mandelbrot = new Mandelbrot(width, height, zoom, centerX, centerY, max);
            MandrelbrotImage.Source = Convert(mandelbrot.mandelBrotFractalBMP());
        }
Esempio n. 2
0
        private void MandrelbrotImage_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (zoomBool)
            {
                System.Windows.Point p = e.GetPosition(this);

                //Width & height
                double minX = centerX - zoom / 2.0;
                double minY = centerY - zoom / 2.0;

                centerX = minX + (double)p.X / width * zoom;
                centerY = minY + (double)p.Y / height * zoom;

                //ZoomScale
                zoom -= 3 * zoom / 10;

                UpdateLabels();

                mandelbrot = new Mandelbrot(width, height, zoom, centerX, centerY, max);
                MandrelbrotImage.Source = Convert(mandelbrot.mandelBrotFractalBMP());
            }
        }
Esempio n. 3
0
 private void Mandelbrot_Fractals_ContentRendered(object sender, EventArgs e)
 {
     mandelbrot = new Mandelbrot(width, height, zoom, centerX, centerY, max);
     MandrelbrotImage.Source = Convert(mandelbrot.mandelBrotFractalBMP());
 }