Draw text gradient list visible in property grid

This commit is contained in:
Jaex 2014-08-04 03:49:24 +03:00
parent ddfa41391f
commit 535332393f
3 changed files with 7 additions and 8 deletions

View file

@ -126,11 +126,10 @@ public int CornerRadius
[DefaultValue(typeof(Color), "0, 20, 40"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
public Color BackgroundColor2 { get; set; }
[Browsable(false), DefaultValue(false)]
[DefaultValue(false)]
public bool UseCustomGradient { get; set; }
// Need custom editor
[Browsable(false)]
// TODO: Need custom editor
public List<GradientStop> CustomGradientList { get; set; }
[DefaultValue(LinearGradientMode.Vertical)]
@ -139,6 +138,7 @@ public int CornerRadius
public DrawText()
{
this.ApplyDefaultPropertyValues();
CustomGradientList = new List<GradientStop>();
}
public override Image Apply(Image img)

View file

@ -26,12 +26,13 @@
using HelpersLib;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
namespace ImageEffectsLib
{
public class GradientStop
{
[DefaultValue(typeof(Color), "Black")]
[DefaultValue(typeof(Color), "Black"), Editor(typeof(MyColorEditor), typeof(UITypeEditor)), TypeConverter(typeof(MyColorConverter))]
public Color Color { get; set; }
private float offset;
@ -45,10 +46,7 @@ public float Offset
}
set
{
if (value >= 0 || value <= 1)
{
offset = value;
}
offset = value.Between(0, 1);
}
}

View file

@ -216,6 +216,7 @@ private void InitializeComponent()
//
// eiImageEffects
//
this.eiImageEffects.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.eiImageEffects.Location = new System.Drawing.Point(8, 734);
this.eiImageEffects.Name = "eiImageEffects";
this.eiImageEffects.ObjectType = null;