Esempio n. 1
0
        public override void PaintValue(PaintValueEventArgs e)
        {
            Graphics     g        = e.Graphics;
            GradientInfo gradient = (GradientInfo)e.Value;

            gradient.Draw(g, e.Bounds);
            g.DrawRectangleProper(Pens.Black, e.Bounds);
        }
Esempio n. 2
0
 public GradientPickerForm(GradientInfo gradient)
 {
     Gradient = gradient;
     InitializeComponent();
     Icon = ShareXResources.Icon;
     cbGradientType.Items.AddRange(Helpers.GetEnumNamesProper<LinearGradientMode>());
     cbGradientType.SelectedIndex = (int)Gradient.Type;
     foreach (GradientStop gradientStop in Gradient.Colors)
     {
         AddGradientStop(gradientStop);
     }
     isReady = true;
     UpdatePreview();
 }
Esempio n. 3
0
 public GradientPickerForm(GradientInfo gradient)
 {
     Gradient = gradient;
     InitializeComponent();
     Icon = ShareXResources.Icon;
     cbGradientType.Items.AddRange(Helpers.GetEnumNamesProper <LinearGradientMode>());
     cbGradientType.SelectedIndex = (int)Gradient.Type;
     foreach (GradientStop gradientStop in Gradient.Colors)
     {
         AddGradientStop(gradientStop);
     }
     isReady = true;
     UpdatePreview();
 }
Esempio n. 4
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (value.GetType() != typeof(GradientInfo))
            {
                return(value);
            }

            IWindowsFormsEditorService svc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (svc != null)
            {
                GradientInfo gradient = (GradientInfo)value;

                using (GradientPickerForm form = new GradientPickerForm(gradient.Copy()))
                {
                    if (svc.ShowDialog(form) == DialogResult.OK)
                    {
                        return(form.Gradient);
                    }
                }
            }

            return(value);
        }
Esempio n. 5
0
        public DrawText()
        {
            this.ApplyDefaultPropertyValues();

            Gradient = new GradientInfo();
            Gradient.Colors.Add(new GradientStop(Color.FromArgb(68, 120, 194), 0f));
            Gradient.Colors.Add(new GradientStop(Color.FromArgb(13, 58, 122), 50f));
            Gradient.Colors.Add(new GradientStop(Color.FromArgb(6, 36, 78), 50f));
            Gradient.Colors.Add(new GradientStop(Color.FromArgb(12, 76, 159), 100f));
        }
Esempio n. 6
0
 private void AddDefaultGradient()
 {
     Gradient = new GradientInfo();
     Gradient.Colors.Add(new GradientStop(Color.FromArgb(68, 120, 194), 0f));
     Gradient.Colors.Add(new GradientStop(Color.FromArgb(13, 58, 122), 50f));
     Gradient.Colors.Add(new GradientStop(Color.FromArgb(6, 36, 78), 50f));
     Gradient.Colors.Add(new GradientStop(Color.FromArgb(23, 89, 174), 100f));
 }