public gpolygon(ColorGradientBar owner, colorpoint _cp)
 {
     RePoints  = owner.standart_of_gpolygon.Select(arg => (double[])arg.Clone()).ToArray();
     cp        = _cp;
     LineColor = owner.standart_of_gpolygon_color;
     Owner     = owner;
     act_move  = (obj, e) => {
         double res = (e.X - Owner.g_left * Owner.Width) / (Owner.g_width * Owner.Width);
         if (res < 0)
         {
             res = 0;
         }
         else if (res > 1)
         {
             res = 1;
         }
         cp.position = res;
         Owner.gpolygons.Sort(new Compar <gpolygon>((x, y) => x.cp.position.CompareTo(y.cp.position)));
         Owner.m_color_gradient_map = Owner.bitmap_liner;
         Owner.Invalidate();
     };
     act_up = (obj, e) => {
         ReturnAim();
     };
 }
        public override System.Windows.Forms.Panel GetUniqueInterface(int width, int height)
        {
            _fcm_data_changed -= Processor;
            Panel Result = new Panel();

            Result.Size = new Size(width, height);
            TrackBar tr     = (TrackBar)_add_standart_rgb_trackbar(Result, 0, 10000, (int)(_gradient_iterations_count % ((ulong)int.MaxValue)), Color.White, 5, 1, 3);
            TrackBar trvoid = (TrackBar)_add_standart_rgb_trackbar(Result, 1, 10000, (int)(_gradient_void_iterations_count % (ulong)int.MaxValue), _gradient_void, 5, 1, 3);

            _gradient_color_changed += (Neo_color) => {
                trvoid.BackColor = Neo_color;
            };
            cgb = _add_standart_color_gradient_bar(Result, 2);
            ComboBox cm = (ComboBox)_add_standart_combo_box(Result, 10, 0, _using_color_modes, null, 1, 3);

            _unique_subinterface          = new Panel();
            _unique_subinterface.Location = new Point(1, cm.Location.Y + cm.Height + 3);
            _unique_subinterface.Size     = new Size(Result.Width - 1, Result.Height - _unique_subinterface.Location.Y);
            Result.Controls.Add(_unique_subinterface);
            if (_using_mod is FractalColorMode)
            {
                _unique_subinterface.Controls.Add(((FractalColorMode)_using_mod).GetUniqueInterface(_unique_subinterface.Width - 1,
                                                                                                    _unique_subinterface.Height - 1));
            }
            cm.SelectedIndex   = get_index_of_using_modes();
            _fcm_data_changed += Processor;
            ToolTip tl = new ToolTip();

            tl.SetToolTip(tr, "Уровень итераций закрашиваемый циклическим градиентом");
            tl.SetToolTip(trvoid, "Уровень итераций после градиентового, который будет закрашиваться цветом пустоты");

            return(Result);
        }
Beispiel #3
0
        protected virtual ColorGradientBar _add_standart_color_gradient_bar(Panel Panel, int ui, int HorizontalShift = 1, int VerticalShift = 5)
        {
            ColorGradientBar Result = new ColorGradientBar();

            Result.Size = new Size(Panel.Width - HorizontalShift * 2 - 15, Result.Height);
            Control lcontrol = Panel.Controls.Count > 0 ? Panel.Controls[Panel.Controls.Count - 1] : null;
            Point   lloc     = lcontrol != null ? lcontrol.Location : new Point(HorizontalShift, VerticalShift);

            if (lcontrol != null)
            {
                lloc = new Point(HorizontalShift, lloc.Y + VerticalShift + lcontrol.Height);
            }
            Result.Location = lloc;
            Panel.Controls.Add(Result);
            Result.Show();
            Result.ColorGradientChanged += (o, e) => { _fcm_on_fcm_data_changed(e, ui, (Control)o); };
            return(Result);
        }
 protected virtual ColorGradientBar _add_standart_color_gradient_bar(Panel Panel,int ui,int HorizontalShift= 1, int VerticalShift = 5)
 {
     ColorGradientBar Result = new ColorGradientBar();
     Result.Size = new Size(Panel.Width - HorizontalShift * 2 - 15, Result.Height);
     Control lcontrol = Panel.Controls.Count > 0 ? Panel.Controls[Panel.Controls.Count - 1] : null;
     Point lloc = lcontrol != null ? lcontrol.Location : new Point(HorizontalShift, VerticalShift);
     if (lcontrol != null) lloc = new Point(HorizontalShift, lloc.Y + VerticalShift + lcontrol.Height);
     Result.Location = lloc;
     Panel.Controls.Add(Result);
     Result.Show();
     Result.ColorGradientChanged += (o, e) => { _fcm_on_fcm_data_changed(e, ui, (Control)o); };
     return Result;
 }
        public override System.Windows.Forms.Panel GetUniqueInterface(int width, int height)
        {
            _fcm_data_changed -= Processor;
            Panel Result = new Panel();
            Result.Size = new Size(width, height);
            TrackBar tr=(TrackBar)_add_standart_rgb_trackbar(Result, 0, 10000, (int)(_gradient_iterations_count % ((ulong)int.MaxValue)), Color.White,5, 1, 3);
            TrackBar trvoid = (TrackBar)_add_standart_rgb_trackbar(Result, 1, 10000, (int)(_gradient_void_iterations_count % (ulong)int.MaxValue), _gradient_void, 5,1, 3);
            _gradient_color_changed+=(Neo_color)=>{
                trvoid.BackColor = Neo_color;
            };
            cgb=_add_standart_color_gradient_bar(Result, 2);
            ComboBox cm= (ComboBox)_add_standart_combo_box(Result, 10, 0,_using_color_modes, null, 1, 3);
            _unique_subinterface = new Panel();
            _unique_subinterface.Location = new Point(1,cm.Location.Y+cm.Height+3);
            _unique_subinterface.Size = new Size(Result.Width - 1, Result.Height - _unique_subinterface.Location.Y);
            Result.Controls.Add(_unique_subinterface);
            if (_using_mod is FractalColorMode) _unique_subinterface.Controls.Add(((FractalColorMode)_using_mod).GetUniqueInterface(_unique_subinterface.Width-1,
                                                                                                                                    _unique_subinterface.Height-1));
            cm.SelectedIndex = get_index_of_using_modes();
            _fcm_data_changed += Processor;
            ToolTip tl = new ToolTip();
            tl.SetToolTip(tr, "Уровень итераций закрашиваемый циклическим градиентом");
            tl.SetToolTip(trvoid, "Уровень итераций после градиентового, который будет закрашиваться цветом пустоты");

            return Result;
        }
 public gpolygon(ColorGradientBar owner, int X) : this(owner,
                                                       new colorpoint(owner.GetColorFromX(X), (X - owner.g_left * owner.Width) / (owner.Width * owner.g_width)))
 {
 }
 public gpolygon(ColorGradientBar owner, Color color, double pos) : this(owner, new colorpoint(color, pos))
 {
 }