コード例 #1
0
 private void вРежимВыбораToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UnCheckConmenu();
     вРежимВыбораToolStripMenuItem.Checked = true;
     fpb1.ToClickMode();
     clickable = true;
 }
コード例 #2
0
 private void JuliaSearcher_Load(object sender, EventArgs e)
 {
     fpb1                  = new FractalPictureBox();
     fpb1.SizeMode         = PictureBoxSizeMode.AutoSize;
     fpb1.ContextMenuStrip = contextMenuStrip1;
     if (_m_fcm == null)
     {
         _m_fcm = new Simple2DFractalColorMode();
     }
     panel1.Controls.Add(fpb1);
     fpb1.ToClickMode();
     if (_mandelbrot == null)
     {
         _mandelbrot = new Mandelbrot();
     }
     _m_fap          = _mandelbrot.CreateFractal(panel1.Width, panel1.Height);
     fpb1.Image      = _m_fcm.GetDrawnBitmap(_m_fap);
     fpb1.MouseMove += (_sender, _e) => { label1.Text = _get_complex_loc(_mandelbrot, _e.X, _e.Y).ToString(); };
     fpb2            = new FractalPictureBox();
     fpb2.SizeMode   = PictureBoxSizeMode.AutoSize;
     panel2.Controls.Add(fpb2);
     fpb1.MouseDown += (_sender, _e) =>
     {
         if (!clickable)
         {
             return;
         }
         if (_e.Button != MouseButtons.Left)
         {
             return;
         }
         _using_complex = _get_complex_loc(_mandelbrot, _e.X, _e.Y);
         label2.Text    = _using_complex.ToString();
         _julia.SetComplex(_using_complex);
         fpb2.Image = _j_fcm.GetDrawnBitmap(((_2DFractal)_julia).CreateFractal(panel2.Width, panel2.Height));
     };
     fpb2.RectangleSelected += (_sender, rec) =>
     {
         ((_2DFractal)_julia).CreateParallelFractal(panel2.Width, panel2.Height, rec.X, rec.Y, rec.Width, rec.Height, true);
     };
     ((_2DFractal)_julia).ParallelFractalCreatingFinished += (s, fap) =>
     {
         Action <Bitmap> act = (bmp) => { fpb2.Image = bmp; };
         Invoke(act, _j_fcm.GetDrawnBitmap(fap));
     };
     fpb2.SelectionPen       = null;
     fpb1.RectangleSelected += (_s, rec) => {
         _mandelbrot.CreateParallelFractal(panel1.Width, panel1.Height, rec.X, rec.Y, rec.Width, rec.Height, true);
     };
     _mandelbrot.ParallelFractalCreatingFinished += (s, fap) =>
     {
         Action <Bitmap> act = (bmp) => { fpb1.Image = bmp; };
         Invoke(act, _m_fcm.GetDrawnBitmap(fap));
     };
     fpb2.ContextMenuStrip = contextMenuStrip2;
     fpb1.SelectionPen     = null;
     clickable             = true;
     _fpb1_h_scale         = this.Width / (double)panel1.Width;
     _fpb1_v_scale         = this.Height / (double)panel1.Height;
     _fpb2_h_scale         = this.Width / (double)panel2.Width;
     _fpb2_v_scale         = this.Height / (double)panel2.Height;
     oldheight             = panel1.Height;
     oldwidth = panel1.Width;
     вРежимВращенияToolStripMenuItem.Visible = вРежимВращенияToolStripMenuItem.Enabled = _mandelbrot is IUsingQuaternion;
 }
コード例 #3
0
 private void JuliaSearcher_Load(object sender, EventArgs e)
 {
     fpb1 = new FractalPictureBox();
     fpb1.SizeMode = PictureBoxSizeMode.AutoSize;
     fpb1.ContextMenuStrip = contextMenuStrip1;
     if(_m_fcm==null)_m_fcm = new Simple2DFractalColorMode();
     panel1.Controls.Add(fpb1);
     fpb1.ToClickMode();
     if(_mandelbrot==null)_mandelbrot = new Mandelbrot();
     _m_fap = _mandelbrot.CreateFractal(panel1.Width, panel1.Height);
     fpb1.Image = _m_fcm.GetDrawnBitmap(_m_fap);
     fpb1.MouseMove += (_sender, _e) => {label1.Text = _get_complex_loc(_mandelbrot,_e.X,_e.Y).ToString(); };
     fpb2 = new FractalPictureBox();
     fpb2.SizeMode = PictureBoxSizeMode.AutoSize;
     panel2.Controls.Add(fpb2);
     fpb1.MouseDown += (_sender, _e) =>
     {
         if (!clickable) return;
         if (_e.Button != MouseButtons.Left) return;
         _using_complex = _get_complex_loc(_mandelbrot, _e.X, _e.Y);
         label2.Text=_using_complex.ToString();
         _julia.SetComplex(_using_complex);
         fpb2.Image = _j_fcm.GetDrawnBitmap(((_2DFractal)_julia).CreateFractal(panel2.Width, panel2.Height));
     };
     fpb2.RectangleSelected += (_sender, rec) =>
     {
         ((_2DFractal)_julia).CreateParallelFractal(panel2.Width, panel2.Height, rec.X, rec.Y, rec.Width, rec.Height, true);
     };
     ((_2DFractal)_julia).ParallelFractalCreatingFinished += (s, fap) =>
     {
     Action<Bitmap> act=(bmp)=>{fpb2.Image=bmp;};
     Invoke(act, _j_fcm.GetDrawnBitmap(fap));
     };
     fpb2.SelectionPen = null;
     fpb1.RectangleSelected += (_s, rec) => {
         _mandelbrot.CreateParallelFractal(panel1.Width, panel1.Height, rec.X, rec.Y, rec.Width, rec.Height,true);
     };
     _mandelbrot.ParallelFractalCreatingFinished += (s, fap) =>
     {
         Action<Bitmap> act = (bmp) => { fpb1.Image = bmp; };
         Invoke(act, _m_fcm.GetDrawnBitmap(fap));
     };
     fpb2.ContextMenuStrip = contextMenuStrip2;
     fpb1.SelectionPen = null;
     clickable = true;
     _fpb1_h_scale = this.Width / (double)panel1.Width;
     _fpb1_v_scale = this.Height / (double)panel1.Height;
     _fpb2_h_scale = this.Width / (double)panel2.Width;
     _fpb2_v_scale = this.Height / (double)panel2.Height;
     oldheight = panel1.Height;
     oldwidth = panel1.Width;
     вРежимВращенияToolStripMenuItem.Visible = вРежимВращенияToolStripMenuItem.Enabled = _mandelbrot is IUsingQuaternion;
 }