Ejemplo n.º 1
0
        private void CalcCombinedFractal()
        {
            fractalPlotter.InitImages(MainImage, PointsImage.Bitmap, BSize);
            fractalPlotter.DoCalculation();

            if (fractalType == FractalType.Julia && mandelbrotInsetBitmap != null && smoozeType == SmoozeType.Single)
            {
                using Graphics g = Graphics.FromImage(PointsImage.Bitmap);
                //  AdjustAspect();
                mandelbrotPlotInset.SmoozeType = SmoozeType.Single;
                mandelbrotPlotInset.XMini      = -2;
                mandelbrotPlotInset.XMaxi      = 0.7;
                mandelbrotPlotInset.YMini      = -1.5;
                mandelbrotPlotInset.YMaxi      = 1.5;
                mandelbrotPlotInset.DoCalculation();
                JuliaPlot p = (JuliaPlot)fractalPlotter;
                mandelbrotPlotInset.AddRedDot(p.Initial_C);
                Rectangle source = new Rectangle(0, 0,
                                                 mandelbrotInsetBitmap.Width, mandelbrotInsetBitmap.Height);
                Rectangle dest = new Rectangle(0, PointsImage.Height - mandelbrotPlotInset.Map.Height, mandelbrotPlotInset.Map.Width, mandelbrotPlotInset.Map.Height);
                g.DrawImage(mandelbrotInsetBitmap.Bitmap, dest, source, GraphicsUnit.Pixel);
            }
            int       cSize    = BSize / 50;
            Rectangle destRect = DestRect;

            try {
                using Graphics g = Graphics.FromImage(MainImage);
                string text = fractalPlotter.Title + ", Escape radius:" + max_MAG_SQUARED + ", Iterations:" + maxIterations;
                g.Clear(Color.LightGray);
                using Pen pen0 = new Pen(Color.Black, 4);
                g.DrawRectangle(pen0, new Rectangle(destRect.X - 1, destRect.Y - 1, destRect.Width + 2, destRect.Height + 2));
                using Pen pen = new Pen(Color.White, 4);
                g.DrawLine(pen, destRect.X - 4, destRect.Y - 1, destRect.Width + destRect.X, destRect.Y - 1);
                g.DrawLine(pen, destRect.X - 1, destRect.Y - 1, destRect.X - 1, destRect.Height + destRect.Y);
                g.DrawString(text, new Font("Calibri", cSize), Brushes.Blue, pictBoxSize.Height / 20, BSize / 70);
                g.DrawString(yMax.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, 5, destRect.Y);
                g.DrawString(yMin.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, 5, destRect.Y + destRect.Height - cSize);
                g.DrawString(xMin.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, destRect.X - cSize, destRect.Y + destRect.Height + cSize / 4);
                g.DrawString(xMax.ToString("0.00"), new Font("Calibri", 2 * cSize / 3), Brushes.Blue, destRect.X + destRect.Width - cSize, destRect.Y + destRect.Height + cSize / 4);

                g.DrawImage(PointsImage.Bitmap, destRect, sourceRect, GraphicsUnit.Pixel);
            }
            catch { }

            fractalPlotter.Copy2GIF(MainImage, BSize, sourceRect);

            if (PlotForm != null)
            {
                PlotForm.FormImage = MainImage;
            }
        }
Ejemplo n.º 2
0
        private void radioButtonCheckedChanged(Object sender, EventArgs e)
        {
            if (radioButtonSingle.Checked)
            {
                smoozeType = SmoozeType.Single;
            }
            if (radioButtonType1.Checked)
            {
                smoozeType = SmoozeType.Type1;
            }
            if (radioButtonType2.Checked)
            {
                smoozeType = SmoozeType.Type2;
            }
            if (radioButtonType3.Checked)
            {
                smoozeType = SmoozeType.Type3;
            }
            mandelbrotPlotInset.SmoozeType = smoozeType;
            combinedControlSettings2MandelBrot();

            mandelbrotPlotInset.DoCalculation();
            Refresh();
        }