コード例 #1
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            List <Property> props = new List <Property>();

            props.Add(new DoubleProperty(PropertyNames.Amount1, 1, 0.2, 10));
            props.Add(new Int32Property(PropertyNames.Amount2, 2, 1, 10));
            props.Add(new BooleanProperty(PropertyNames.Amount3, false));
            props.Add(new Int32Property(PropertyNames.Amount4, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.PrimaryColor.B, EnvironmentParameters.PrimaryColor.G, EnvironmentParameters.PrimaryColor.R, 255)), 0, 0xffffff));
            props.Add(new DoubleVectorProperty(PropertyNames.Amount5, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0)));

            List <PropertyCollectionRule> propRules = new List <PropertyCollectionRule>();

            propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.Amount4, PropertyNames.Amount3, false));

            return(new PropertyCollection(props, propRules));
        }
コード例 #2
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            Property[] props = new Property[]
            {
                new StringProperty(PropertyNames.Text, "", 255),
                new Int32Property(PropertyNames.TextRepeat, 100, 1, 1000),
                new Int32Property(PropertyNames.FontSize, 12, 6, 250),
                new StaticListChoiceProperty(PropertyNames.Font, FontUtil.UsableFontFamilies, FontUtil.FindFontIndex("Arial"), false),
                new BooleanProperty(PropertyNames.Bold, false),
                new BooleanProperty(PropertyNames.Italic, false),
                new BooleanProperty(PropertyNames.Underline, false),
                new BooleanProperty(PropertyNames.Strikeout, false),
                new DoubleVectorProperty(PropertyNames.Offset, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0)),
                new Int32Property(PropertyNames.BackColor, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.PrimaryColor.B, EnvironmentParameters.PrimaryColor.G, EnvironmentParameters.PrimaryColor.R, 255)), 0, 0xffffff)
            };

            return(new PropertyCollection(props));
        }
コード例 #3
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            List <Property> props = new List <Property>
            {
                new StringProperty(PropertyNames.Amount1, "", 10000),
                new Int32Property(PropertyNames.Amount2, 100, 1, 1000),
                new Int32Property(PropertyNames.Amount3, 12, 6, 250),
                new StaticListChoiceProperty(PropertyNames.Amount4, FontUtil.UsableFontFamilies, FontUtil.FindFontIndex("Arial"), false),
                new BooleanProperty(PropertyNames.Amount5, false),
                new BooleanProperty(PropertyNames.Amount6, false),
                new BooleanProperty(PropertyNames.Amount7, false),
                new BooleanProperty(PropertyNames.Amount8, false),
                new DoubleVectorProperty(PropertyNames.Amount9, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0)),
                new Int32Property(PropertyNames.Amount10, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.PrimaryColor.B, EnvironmentParameters.PrimaryColor.G, EnvironmentParameters.PrimaryColor.R, 255)), 0, 0xffffff)
            };

            return(new PropertyCollection(props));
        }
コード例 #4
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            IEnumerable <Property> props = new Property[]
            {
                new DoubleProperty(PropertyNames.Scale, 1, 0.2, 10),
                new Int32Property(PropertyNames.LineWidth, 2, 1, 10),
                StaticListChoiceProperty.CreateForEnum <Pattern>(PropertyNames.Pattern, 0, false),
                new BooleanProperty(PropertyNames.Transparent, true),
                new Int32Property(PropertyNames.LineColor, ColorBgra.ToOpaqueInt32(EnvironmentParameters.PrimaryColor.NewAlpha(byte.MaxValue)), 0, 0xffffff),
                new DoubleVectorProperty(PropertyNames.Offset, Pair.Create(0.0, 0.0), Pair.Create(-1.0, -1.0), Pair.Create(+1.0, +1.0))
            };

            IEnumerable <PropertyCollectionRule> propRules = new PropertyCollectionRule[]
            {
                new ReadOnlyBoundToBooleanRule(PropertyNames.LineColor, PropertyNames.Transparent, false)
            };

            return(new PropertyCollection(props, propRules));
        }
コード例 #5
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            Rectangle selection     = EnvironmentParameters.GetSelection(EnvironmentParameters.SourceSurface.Bounds).GetBoundsInt();
            int       radiusMax     = Math.Min(selection.Width, selection.Height) / 2;
            int       radiusDefault = radiusMax / 2;

            List <Property> props = new List <Property>();

            props.Add(new Int32Property(PropertyNames.Amount1, radiusDefault, 1, radiusMax));
            props.Add(new Int32Property(PropertyNames.Amount5, 0, 0, radiusMax));
            props.Add(new BooleanProperty(PropertyNames.Amount2, true));
            props.Add(new Int32Property(PropertyNames.Amount3, ColorBgra.ToOpaqueInt32(ColorBgra.FromBgra(EnvironmentParameters.PrimaryColor.B, EnvironmentParameters.PrimaryColor.G, EnvironmentParameters.PrimaryColor.R, 255)), 0, 0xffffff));
            props.Add(new BooleanProperty(PropertyNames.Amount4, true));

            List <PropertyCollectionRule> propRules = new List <PropertyCollectionRule>();

            propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.Amount3, PropertyNames.Amount2, false));

            return(new PropertyCollection(props, propRules));
        }
コード例 #6
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            ColorBgra PrimaryColor = EnvironmentParameters.PrimaryColor.NewAlpha(255);

            List <Property> props = new List <Property>
            {
                new Int32Property(PropertyNames.Scale, 50, 3, 100),
                new DoubleProperty(PropertyNames.Roughness, 1.0, 0, 1.0),
                new Int32Property(PropertyNames.MinimumOpacity, 85, byte.MinValue, byte.MaxValue),
                new Int32Property(PropertyNames.Reseed, 0, 0, 255),
                new BooleanProperty(PropertyNames.UseCustomColor, false),
                new Int32Property(PropertyNames.Color, ColorBgra.ToOpaqueInt32(PrimaryColor), 0, 0xffffff)
            };

            List <PropertyCollectionRule> propRules = new List <PropertyCollectionRule>
            {
                new ReadOnlyBoundToBooleanRule(PropertyNames.Color, PropertyNames.UseCustomColor, true)
            };

            return(new PropertyCollection(props, propRules));
        }
コード例 #7
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            Size selection     = EnvironmentParameters.SelectionBounds.Size;
            int  radiusMax     = Math.Min(selection.Width, selection.Height) / 2;
            int  radiusDefault = radiusMax / 2;

            IEnumerable <Property> props = new Property[]
            {
                new Int32Property(PropertyNames.Radius, radiusDefault, 1, radiusMax),
                new BooleanProperty(PropertyNames.AntiAliasing, true),
                new Int32Property(PropertyNames.Margin, 0, 0, radiusMax),
                new BooleanProperty(PropertyNames.TransparentBack, true),
                new Int32Property(PropertyNames.BackColor, ColorBgra.ToOpaqueInt32(EnvironmentParameters.PrimaryColor.NewAlpha(byte.MaxValue)), 0, 0xffffff)
            };

            IEnumerable <PropertyCollectionRule> propRules = new PropertyCollectionRule[]
            {
                new ReadOnlyBoundToBooleanRule(PropertyNames.BackColor, PropertyNames.TransparentBack, false)
            };

            return(new PropertyCollection(props, propRules));
        }
コード例 #8
0
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            ColorBgra PrimaryColor   = EnvironmentParameters.PrimaryColor.NewAlpha(byte.MaxValue);
            ColorBgra SecondaryColor = EnvironmentParameters.SecondaryColor.NewAlpha(byte.MaxValue);

            List <Property> props = new List <Property>();

            props.Add(new DoubleProperty(PropertyNames.M_TintStrength, 1, 0, 1));
            props.Add(new BooleanProperty(PropertyNames.M_UseRgbPicker, true));
            props.Add(new Int32Property(PropertyNames.M_RgbColor, ColorBgra.ToOpaqueInt32(PrimaryColor), 0, 0xffffff));
            props.Add(new Int32Property(PropertyNames.M_H, 0, 0, 360));
            props.Add(new Int32Property(PropertyNames.M_S, 100, 0, 100));
            props.Add(new Int32Property(PropertyNames.M_V, 100, 0, 100));

            List <PropertyCollectionRule> propRules = new List <PropertyCollectionRule>();

            propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.M_RgbColor, PropertyNames.M_UseRgbPicker, true));
            propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.M_H, PropertyNames.M_UseRgbPicker, false));
            propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.M_S, PropertyNames.M_UseRgbPicker, false));
            propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.M_V, PropertyNames.M_UseRgbPicker, false));

            return(new PropertyCollection(props, propRules));
        }