void PlaceFill( FillType fillType, Vector2 position )
    {
        GameObject go = null;
        switch (fillType)
        {
        case FillType.A: go = prefabA.GetNextFree(); break;
        case FillType.B: go = prefabB.GetNextFree(); break;
        default:break;
        }

        if (go != null)
        {
            go.SetActive(true);
            go.transform.position = position;
        }
    }
Exemple #2
0
 /// <summary>
 /// Constructor that creates a texture fill, setting <see cref="Type"/> to
 /// <see cref="FillType.Brush"/> and using the specified image.
 /// </summary>
 /// <param name="image">The <see cref="Image"/> to use for filling</param>
 /// <param name="wrapMode">The <see cref="WrapMode"/> class that controls the image wrapping properties</param>
 public Fill( Image image, WrapMode wrapMode )
 {
     Init();
     _color = Color.White;
     _brush = new TextureBrush( image, wrapMode );
     _type = FillType.Brush;
     _image = image;
     _wrapMode = wrapMode;
 }
Exemple #3
0
        /// <summary>
        /// Constructor that creates a linear gradient multi-color-fill, setting <see cref="Type"/> to
        /// <see cref="FillType.Brush"/> using the specified colors.  This gradient fill
        /// consists of many colors based on an array of <see cref="Color"/> objects, drawn at the
        /// specified angle (degrees).  The <see paramref="colors"/> array is used to create
        /// a <see cref="ColorBlend"/> object assuming a even linear distribution of the colors
        /// across the gradient.
        /// </summary>
        /// <param name="colors">The array of <see cref="Color"/> objects that defines the colors
        /// along the gradient.</param>
        /// <param name="angle">The angle (degrees) of the gradient fill</param>
        public Fill( Color[] colors, float angle )
        {
            Init();
            _color = colors[ colors.Length - 1 ];

            ColorBlend blend = new ColorBlend();
            blend.Colors = colors;
            blend.Positions = new float[colors.Length];
            blend.Positions[0] = 0.0F;
            for ( int i=1; i<colors.Length; i++ )
                blend.Positions[i] = (float) i / (float)( colors.Length - 1 );
            _type = FillType.Brush;

            this.CreateBrushFromBlend( blend, angle );
        }
Exemple #4
0
        /// <summary>
        /// Constructor that creates a linear gradient color-fill, setting <see cref="Type"/> to
        /// <see cref="FillType.Brush"/> using the specified colors.  This gradient fill
        /// consists of three colors
        /// </summary>
        /// <param name="color1">The first color for the gradient fill</param>
        /// <param name="color2">The second color for the gradient fill</param>
        /// <param name="color3">The third color for the gradient fill</param>
        /// <param name="angle">The angle (degrees) of the gradient fill</param>
        public Fill( Color color1, Color color2, Color color3, float angle )
        {
            Init();
            _color = color3;

            ColorBlend blend = new ColorBlend( 3 );
            blend.Colors[0] = color1;
            blend.Colors[1] = color2;
            blend.Colors[2] = color3;
            blend.Positions[0] = 0.0f;
            blend.Positions[1] = 0.5f;
            blend.Positions[2] = 1.0f;
            _type = FillType.Brush;

            this.CreateBrushFromBlend( blend, angle );
        }
Exemple #5
0
 /// <summary>
 /// Constructor that specifies the color, brush, and type for this fill.
 /// </summary>
 /// <param name="color">The color of the fill for solid fills</param>
 /// <param name="brush">A custom brush for fills.  Can be a <see cref="SolidBrush"/>,
 /// <see cref="LinearGradientBrush"/>, or <see cref="TextureBrush"/>.</param>
 /// <param name="type">The <see cref="FillType"/> for this fill.</param>
 public Fill( Color color, Brush brush, FillType type )
 {
     Init();
     _color = color;
     _brush = brush;
     _type = type;
 }
Exemple #6
0
        /// <summary>
        /// Construct a <see cref="FontSpec"/> object with the given properties.  All other properties
        /// are defaulted according to the values specified in the <see cref="Default"/>
        /// default class.
        /// </summary>
        /// <param name="family">A text string representing the font family
        /// (default is "Arial")</param>
        /// <param name="size">A size of the font in points.  This size will be scaled
        /// based on the ratio of the <see cref="PaneBase.Rect"/> dimension to the
        /// <see cref="PaneBase.BaseDimension"/> of the <see cref="GraphPane"/> object. </param>
        /// <param name="color">The color with which to render the font</param>
        /// <param name="isBold">true for a bold typeface, false otherwise</param>
        /// <param name="isItalic">true for an italic typeface, false otherwise</param>
        /// <param name="isUnderline">true for an underlined font, false otherwise</param>
        /// <param name="fillColor">The <see cref="Color"/> to use for filling in the text background</param>
        /// <param name="fillBrush">The <see cref="Brush"/> to use for filling in the text background</param>
        /// <param name="fillType">The <see cref="ZedGraph.FillType"/> to use for the
        /// text background</param>
        public FontSpec( string family, float size, Color color, bool isBold,
							bool isItalic, bool isUnderline, Color fillColor, Brush fillBrush,
							FillType fillType )
        {
            Init( family, size, color, isBold, isItalic, isUnderline,
                    fillColor, fillBrush, fillType );
        }
        public override void Setup_BeforeAdd(XML xml)
        {
            base.Setup_BeforeAdd(xml);

            string str;
            str = xml.GetAttribute("url");
            if (str != null)
                _url = str;

            str = xml.GetAttribute("align");
            if (str != null)
                _align = FieldTypes.ParseAlign(str);

            str = xml.GetAttribute("vAlign");
            if (str != null)
                _verticalAlign = FieldTypes.ParseVerticalAlign(str);

            str = xml.GetAttribute("fill");
            if (str != null)
                _fill = FieldTypes.ParseFillType(str);

            _autoSize = xml.GetAttributeBool("autoSize", false);

            str = xml.GetAttribute("errorSign");
            if (str != null)
                showErrorSign = str == "true";

            _playing = xml.GetAttributeBool("playing", true);

            str = xml.GetAttribute("color");
            if (str != null)
                this.color = ToolSet.ConvertFromHtmlColor(str);

            str = xml.GetAttribute("fillMethod");
            if (str != null)
                _content.fillMethod = FieldTypes.ParseFillMethod(str);

            if (_content.fillMethod != FillMethod.None)
            {
                _content.fillOrigin = xml.GetAttributeInt("fillOrigin");
                _content.fillClockwise = xml.GetAttributeBool("fillClockwise", true);
                _content.fillAmount = (float)xml.GetAttributeInt("fillAmount", 100) / 100;
            }

            if (_url != null)
                LoadContent();
        }
Exemple #8
0
        public void FloodFill(Player p, ushort x, ushort y, ushort z, byte b, byte oldType, FillType fillType, ref byte[] blocks, ref List<Pos> buffer)
        {
            try
            {
                Pos pos;
                pos.x = x; pos.y = y; pos.z = z;

                if (deep > 4000)
                {
                    fromWhere.Add(pos);
                    return;
                }

                blocks[x + p.level.width * z + p.level.width * p.level.height * y] = b;
                buffer.Add(pos);

                //x
                if (fillType != FillType.VerticalX)
                {
                    if (GetTile((ushort)(x + 1), y, z, p.level, blocks) == oldType)
                    {
                        deep++;
                        FloodFill(p, (ushort)(x + 1), y, z, b, oldType, fillType, ref blocks, ref buffer);
                        deep--;
                    }

                    if (x > 0)
                        if (GetTile((ushort)(x - 1), y, z, p.level, blocks) == oldType)
                        {
                            deep++;
                            FloodFill(p, (ushort)(x - 1), y, z, b, oldType, fillType, ref blocks, ref buffer);
                            deep--;
                        }
                }

                //z
                if (fillType != FillType.VerticalZ)
                {
                    if (GetTile(x, y, (ushort)(z + 1), p.level, blocks) == oldType)
                    {
                        deep++;
                        FloodFill(p, x, y, (ushort)(z + 1), b, oldType, fillType, ref blocks, ref buffer);
                        deep--;
                    }

                    if (z > 0)
                        if (GetTile(x, y, (ushort)(z - 1), p.level, blocks) == oldType)
                        {
                            deep++;
                            FloodFill(p, x, y, (ushort)(z - 1), b, oldType, fillType, ref blocks, ref buffer);
                            deep--;
                        }
                }

                //y
                if (fillType == 0 || fillType == FillType.Up || fillType > FillType.Layer)
                {
                    if (GetTile(x, (ushort)(y + 1), z, p.level, blocks) == oldType)
                    {
                        deep++;
                        FloodFill(p, x, (ushort)(y + 1), z, b, oldType, fillType, ref blocks, ref buffer);
                        deep--;
                    }
                }

                if (fillType == 0 || fillType == FillType.Down || fillType > FillType.Layer)
                {
                    if (y > 0)
                        if (GetTile(x, (ushort)(y - 1), z, p.level, blocks) == oldType)
                        {
                            deep++;
                            FloodFill(p, x, (ushort)(y - 1), z, b, oldType, fillType, ref blocks, ref buffer);
                            deep--;
                        }
                }
            } catch (Exception e) { Server.ErrorLog(e); }
        }
Exemple #9
0
        override public void Setup_BeforeAdd(XML xml)
        {
            base.Setup_BeforeAdd(xml);

            string str;

            str = xml.GetAttribute("url");
            if (str != null)
            {
                _url = str;
            }

            str = xml.GetAttribute("align");
            if (str != null)
            {
                _align = FieldTypes.ParseAlign(str);
            }

            str = xml.GetAttribute("vAlign");
            if (str != null)
            {
                _verticalAlign = FieldTypes.ParseVerticalAlign(str);
            }

            str = xml.GetAttribute("fill");
            if (str != null)
            {
                _fill = FieldTypes.ParseFillType(str);
            }

            _autoSize = xml.GetAttributeBool("autoSize", false);

            str = xml.GetAttribute("errorSign");
            if (str != null)
            {
                showErrorSign = str == "true";
            }

            str = xml.GetAttribute("frame");
            if (str != null)
            {
                _content.currentFrame = int.Parse(str);
            }
            _content.playing = xml.GetAttributeBool("playing", true);

            str = xml.GetAttribute("color");
            if (str != null)
            {
                _content.color = ToolSet.ConvertFromHtmlColor(str);
            }

            str = xml.GetAttribute("fillMethod");
            if (str != null)
            {
                _content.fillMethod = FieldTypes.ParseFillMethod(str);
            }

            if (_content.fillMethod != FillMethod.None)
            {
                _content.fillOrigin    = xml.GetAttributeInt("fillOrigin");
                _content.fillClockwise = xml.GetAttributeBool("fillClockwise", true);
                _content.fillAmount    = (float)xml.GetAttributeInt("fillAmount", 100) / 100;
            }

            if (_url != null)
            {
                LoadContent();
            }
        }
Exemple #10
0
 public CompositionBuilder FillType(FillType type)
 {
     _composition.Fill.Type = type;
     return(this);
 }
Exemple #11
0
 /// <summary>
 /// Constructor that creates a linear gradient multi-color-fill, setting <see cref="Type"/> to
 /// <see cref="FillType.Brush"/> using the specified colors.  This gradient fill
 /// consists of many colors based on a <see cref="ColorBlend"/> object, drawn at the
 /// specified angle (degrees).
 /// </summary>
 /// <param name="blend">The <see cref="ColorBlend"/> object that defines the colors
 /// and positions along the gradient.</param>
 /// <param name="angle">The angle (degrees) of the gradient fill</param>
 public Fill(ColorBlend blend, float angle)
 {
     Init();
     _type = FillType.Brush;
     this.CreateBrushFromBlend(blend, angle);
 }
Exemple #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v"></param>
 /// <returns></returns>
 public static string ToString(FillType v)
 {
     return(Enum.GetName(typeof(FillType), v).ToLowerInvariant());
 }
Exemple #13
0
        public void FloodFill(Player p, ushort x, ushort y, ushort z, byte b, byte oldType, FillType fillType, ref byte[] blocks, ref List <Pos> buffer)
        {
            try
            {
                Pos pos;
                pos.x = x; pos.y = y; pos.z = z;

                if (deep > 4000)
                {
                    fromWhere.Add(pos);
                    return;
                }

                blocks[x + p.level.width * z + p.level.width * p.level.height * y] = b;
                buffer.Add(pos);

                //x
                if (fillType != FillType.VerticalX)
                {
                    if (GetTile((ushort)(x + 1), y, z, p.level, blocks) == oldType)
                    {
                        deep++;
                        FloodFill(p, (ushort)(x + 1), y, z, b, oldType, fillType, ref blocks, ref buffer);
                        deep--;
                    }

                    if (x > 0)
                    {
                        if (GetTile((ushort)(x - 1), y, z, p.level, blocks) == oldType)
                        {
                            deep++;
                            FloodFill(p, (ushort)(x - 1), y, z, b, oldType, fillType, ref blocks, ref buffer);
                            deep--;
                        }
                    }
                }

                //z
                if (fillType != FillType.VerticalZ)
                {
                    if (GetTile(x, y, (ushort)(z + 1), p.level, blocks) == oldType)
                    {
                        deep++;
                        FloodFill(p, x, y, (ushort)(z + 1), b, oldType, fillType, ref blocks, ref buffer);
                        deep--;
                    }

                    if (z > 0)
                    {
                        if (GetTile(x, y, (ushort)(z - 1), p.level, blocks) == oldType)
                        {
                            deep++;
                            FloodFill(p, x, y, (ushort)(z - 1), b, oldType, fillType, ref blocks, ref buffer);
                            deep--;
                        }
                    }
                }

                //y
                if (fillType == 0 || fillType == FillType.Up || fillType > FillType.Layer)
                {
                    if (GetTile(x, (ushort)(y + 1), z, p.level, blocks) == oldType)
                    {
                        deep++;
                        FloodFill(p, x, (ushort)(y + 1), z, b, oldType, fillType, ref blocks, ref buffer);
                        deep--;
                    }
                }

                if (fillType == 0 || fillType == FillType.Down || fillType > FillType.Layer)
                {
                    if (y > 0)
                    {
                        if (GetTile(x, (ushort)(y - 1), z, p.level, blocks) == oldType)
                        {
                            deep++;
                            FloodFill(p, x, (ushort)(y - 1), z, b, oldType, fillType, ref blocks, ref buffer);
                            deep--;
                        }
                    }
                }
            } catch (Exception e) { Server.ErrorLog(e); }
        }
 override protected void Reset()
 {
     base.Reset();
     Type = FillType.Fill;
 }
Exemple #15
0
 /// <summary>
 /// Constructor that creates a <see cref="Brush"/> fill, using a user-supplied, custom
 /// <see cref="Brush"/>.  This constructor will make the brush unscaled (see <see cref="IsScaled"/>),
 /// but it provides <see paramref="alignH"/> and <see paramref="alignV"/> parameters to control
 /// alignment of the brush with respect to the filled object.
 /// </summary>
 /// <param name="brush">The <see cref="Brush"/> to use for fancy fills.  Typically, this would
 /// be a <see cref="LinearGradientBrush"/> or a <see cref="TextureBrush"/> class</param>
 /// <param name="alignH">Controls the horizontal alignment of the brush within the filled object
 /// (see <see cref="AlignH"/></param>
 /// <param name="alignV">Controls the vertical alignment of the brush within the filled object
 /// (see <see cref="AlignV"/></param>
 public Fill( Brush brush, AlignH alignH, AlignV alignV )
 {
     Init();
     _alignH = alignH;
     _alignV = alignV;
     _isScaled = false;
     _color = Color.White;
     _brush = (Brush) brush.Clone();
     _type = FillType.Brush;
 }
Exemple #16
0
 /// <summary>
 /// Generic initializer to default values
 /// </summary>
 private void Init()
 {
     color = Color.White;
     brush = null;
     type = FillType.None;
     this.isScaled = Default.IsScaled;
     this.alignH = Default.AlignH;
     this.alignV = Default.AlignV;
     this.rangeMin = 0.0;
     this.rangeMax = 1.0;
     gradientBM = null;
 }
Exemple #17
0
        // schema changed to 2 with addition of rangeDefault
        // schema changed to 10 with version 5 refactor -- not backwards compatible
        /// <summary>
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected Fill( SerializationInfo info, StreamingContext context )
        {
            Init();

            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32( "schema" );

            _color = (Color) info.GetValue( "color", typeof(Color) );
            _secondaryValueGradientColor = (Color) info.GetValue( "secondaryValueGradientColor", typeof( Color ) );
            //brush = (Brush) info.GetValue( "brush", typeof(Brush) );
            //brushHolder = (BrushHolder) info.GetValue( "brushHolder", typeof(BrushHolder) );
            _type = (FillType) info.GetValue( "type", typeof(FillType) );
            _isScaled = info.GetBoolean( "isScaled" );
            _alignH = (AlignH) info.GetValue( "alignH", typeof(AlignH) );
            _alignV = (AlignV) info.GetValue( "alignV", typeof(AlignV) );
            _rangeMin = info.GetDouble( "rangeMin" );
            _rangeMax = info.GetDouble( "rangeMax" );

            //BrushHolder brushHolder = (BrushHolder) info.GetValue( "brushHolder", typeof( BrushHolder ) );
            //brush = brush;

            _colorList = (Color[]) info.GetValue( "colorList", typeof(Color[]) );
            _positionList = (float[]) info.GetValue( "positionList", typeof(float[]) );
            _angle = info.GetSingle( "angle" );
            _image = (Image) info.GetValue( "image", typeof(Image) );
            _wrapMode = (WrapMode) info.GetValue( "wrapMode", typeof(WrapMode) );

            if ( _colorList != null && _positionList != null )
            {
                ColorBlend blend = new ColorBlend();
                blend.Colors = _colorList;
                blend.Positions = _positionList;
                CreateBrushFromBlend( blend, _angle );
            }
            else if ( _image != null )
            {
                _brush = new TextureBrush( _image, _wrapMode );
            }

            _rangeDefault = info.GetDouble( "rangeDefault" );
        }
Exemple #18
0
 public BitmapFill(uint characterId, Matrix matrix, FillType fillType)
 {
     this.CharacterId = characterId;
     this.Matrix = matrix;
     this.fillType = fillType;
 }
Exemple #19
0
 internal BitmapFill(uint characterId, Matrix matrix, FillType fillType)
 {
     this.CharacterId = characterId;
     this.Matrix      = matrix;
     this.fillType    = fillType;
 }
Exemple #20
0
 /// <summary>
 /// The ExtFloodFill function fills an area of the display surface with the current brush
 /// </summary>
 /// <param name="hdc">Handle to a device context</param>
 /// <param name="x">Specifies the x-coordinate, in logical units, of the point where filling is to start</param>
 /// <param name="y">Specifies the y-coordinate, in logical units, of the point where filling is to start</param>
 /// <param name="color">Specifies the color of the boundary or of the area to be filled. The interpretation of
 /// color depends on the value of the fuFillType parameter. To create a COLORREF color value, use the RGB macro</param>
 /// <param name="fuFillType">Specifies the type of fill operation to be performed</param>
 /// <returns>If the function succeeds, the return value is true, else false</returns>
 public static bool ExtFloodFill([In] IntPtr hdc, int x, int y, Color color, FillType fuFillType)
 {
     return Native.ExtFloodFill(hdc, x, y, RGB.ToWin32Color(color), fuFillType);
 }
Exemple #21
0
        private void Init( string family, float size, Color color, bool isBold,
			bool isItalic, bool isUnderline, Color fillColor, Brush fillBrush,
			FillType fillType )
        {
            _fontColor = color;
            _family = family;
            _isBold = isBold;
            _isItalic = isItalic;
            _isUnderline = isUnderline;
            _size = size;
            _angle = 0F;

            _isAntiAlias = Default.IsAntiAlias;
            _stringAlignment = Default.StringAlignment;
            _isDropShadow = Default.IsDropShadow;
            _dropShadowColor = Default.DropShadowColor;
            _dropShadowAngle = Default.DropShadowAngle;
            _dropShadowOffset = Default.DropShadowOffset;
            _scaleFactor = Default.ScaleFactor;

            _fill = new Fill( fillColor, fillBrush, fillType );
            _border = new Border( true, Color.Black, 1.0F );

            _scaledSize = -1;
            Remake( 1.0F, _size, ref _scaledSize, ref _font );
        }
Exemple #22
0
 public static extern bool ExtFloodFill([In] IntPtr hdc, int x, int y, uint color, FillType type);
Exemple #23
0
 public HeiiRuleCurve(string cbtt, int waterYear,FillType fType)
     : base(cbtt,fType)
 {
     Init(waterYear);
 }
Exemple #24
0
        /// <summary>
        /// Constructor that creates a linear gradient color-fill, setting <see cref="Type"/> to
        /// <see cref="FillType.Brush"/> using the specified colors and angle.
        /// </summary>
        /// <param name="color1">The first color for the gradient fill</param>
        /// <param name="color2">The second color for the gradient fill</param>
        /// <param name="angle">The angle (degrees) of the gradient fill</param>
        public Fill(Color color1, Color color2, float angle)
        {
            Init();
            _color = color2;

            var blend = new ColorBlend(2);
            blend.Colors[0] = color1;
            blend.Colors[1] = color2;
            blend.Positions[0] = 0.0f;
            blend.Positions[1] = 1.0f;
            _type = FillType.Brush;

            CreateBrushFromBlend(blend, angle);
        }
Exemple #25
0
 /// <summary>
 /// Constructor that creates a solid color-fill, setting <see cref="Type"/> to
 /// <see cref="FillType.Solid"/>, and setting <see cref="Color"/> to the
 /// specified color value.
 /// </summary>
 /// <param name="color">The color of the solid fill</param>
 public Fill( Color color )
 {
     Init();
     _color = color;
     if ( color != Color.Empty )
         _type = FillType.Solid;
 }
Exemple #26
0
        public override void Setup_BeforeAdd(XML xml)
        {
            base.Setup_BeforeAdd(xml);

            string str;
            str = xml.GetAttribute("url");
            if (str != null)
                _url = str;

            str = xml.GetAttribute("align");
            if (str != null)
                _align = FieldTypes.ParseAlign(str);

            str = xml.GetAttribute("vAlign");
            if (str != null)
                _verticalAlign = FieldTypes.ParseVerticalAlign(str);

            str = xml.GetAttribute("fill");
            if (str != null)
                _fill = FieldTypes.ParseFillType(str);

            _autoSize = xml.GetAttributeBool("autoSize", false);

            str = xml.GetAttribute("errorSign");
            if (str != null)
                showErrorSign = str == "true";

            _playing = xml.GetAttributeBool("playing", true);

            str = xml.GetAttribute("color");
            if (str != null)
                this.color = ToolSet.ConvertFromHtmlColor(str);

            if (_url != null)
                LoadContent();
        }
Exemple #27
0
 /// <summary>
 /// Constructor that creates a linear gradient multi-color-fill, setting <see cref="Type"/> to
 /// <see cref="FillType.Brush"/> using the specified colors.  This gradient fill
 /// consists of many colors based on a <see cref="ColorBlend"/> object, drawn at the
 /// specified angle (degrees).
 /// </summary>
 /// <param name="blend">The <see cref="ColorBlend"/> object that defines the colors
 /// and positions along the gradient.</param>
 /// <param name="angle">The angle (degrees) of the gradient fill</param>
 public Fill( ColorBlend blend, float angle )
 {
     Init();
     _type = FillType.Brush;
     this.CreateBrushFromBlend( blend, angle );
 }
		/// <summary>
		/// Renders a rectangular background portion of a control.
		/// </summary>
		protected virtual void FillRectangle(Coord relPos, Coord size, Corner rounded, FillType fillType, HitState hitState, AnchorLocation location)
		{
			var point = Context.Push();
			var coord = new Coord(point.X + relPos.X, point.Y + relPos.Y);
			
			switch (fillType)
			{
			case FillType.Background:
				Context.Cairo.Pattern = GenerateGradient(coord, size, location, 
                                             GetColor(ColorType.BackgroundStart, hitState),
                                             GetColor(ColorType.BackgroundStop, hitState));
				break;
			case FillType.Editable:
				Context.Cairo.Pattern = GenerateGradient(coord, size, location, 
                                             GetColor(ColorType.EditableStart, hitState),
                                             GetColor(ColorType.EditableStop, hitState));
				break;
			case FillType.Highlight:
				Context.Cairo.Pattern = GenerateGradient(coord, size, location, 
                                             GetColor(ColorType.HighlightStart, hitState),
                                             GetColor(ColorType.HighlightStop, hitState));
				break;
			case FillType.Selection:
				Context.Cairo.Color = SelectionColor.ToCairo();
				break;
			}
			
			// draw the rectangle
			Context.Cairo.Operator = Cairo.Operator.Source;
			RectanglePath(coord.Round + 1, size.Floor - 2, rounded);
			Context.Cairo.Fill();
			
			Context.Pop();
		}
Exemple #29
0
        /// <summary>
        /// Constructor that creates a linear gradient multi-color-fill, setting <see cref="Type"/> to
        /// <see cref="FillType.Brush"/> using the specified colors.  This gradient fill
        /// consists of many colors based on an array of <see cref="Color"/> objects, drawn at the
        /// specified angle (degrees).  The <see paramref="colors"/> array is used to create
        /// a <see cref="ColorBlend"/> object assuming a even linear distribution of the colors
        /// across the gradient.
        /// </summary>
        /// <param name="colors">The array of <see cref="Color"/> objects that defines the colors
        /// along the gradient.</param>
        /// <param name="positions">The array of floating point values that defines the color
        /// positions along the gradient.  Values should range from 0 to 1.</param>
        /// <param name="angle">The angle (degrees) of the gradient fill</param>
        public Fill( Color[] colors, float[] positions, float angle )
        {
            Init();
            _color = colors[ colors.Length - 1 ];

            ColorBlend blend = new ColorBlend();
            blend.Colors = colors;
            blend.Positions = positions;
            _type = FillType.Brush;

            this.CreateBrushFromBlend( blend, angle );
        }
Exemple #30
0
 public void EditFill(FillType fill_type)
 {
     if (!gimp_edit_fill(ID, fill_type))
     {
       throw new GimpSharpException();
     }
 }
Exemple #31
0
 /// <summary>
 /// Constructor that creates a <see cref="Brush"/> fill, using a user-supplied, custom
 /// <see cref="Brush"/>.  The brush will be scaled to fit the destination screen object
 /// according to the <see paramref="isScaled"/> parameter.
 /// </summary>
 /// <param name="brush">The <see cref="Brush"/> to use for fancy fills.  Typically, this would
 /// be a <see cref="LinearGradientBrush"/> or a <see cref="TextureBrush"/> class</param>
 /// <param name="isScaled">Determines if the brush will be scaled to fit the bounding box
 /// of the destination object.  true to scale it, false to leave it unscaled</param>
 public Fill( Brush brush, bool isScaled )
 {
     Init();
     _isScaled = isScaled;
     _color = Color.White;
     _brush = (Brush) brush.Clone();
     _type = FillType.Brush;
 }
Exemple #32
0
 public void Fill(FillType fill_type)
 {
     if (!gimp_drawable_fill(ID, fill_type))
     {
       throw new GimpSharpException();
     }
 }
Exemple #33
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The Fill object from which to copy</param>
        public Fill( Fill rhs )
        {
            _color = rhs._color;
            _secondaryValueGradientColor = rhs._color;

            if ( rhs._brush != null )
                _brush = (Brush) rhs._brush.Clone();
            else
                _brush = null;
            _type = rhs._type;
            _alignH = rhs.AlignH;
            _alignV = rhs.AlignV;
            _isScaled = rhs.IsScaled;
            _rangeMin = rhs._rangeMin;
            _rangeMax = rhs._rangeMax;
            _rangeDefault = rhs._rangeDefault;
            _gradientBM = null;

            if ( rhs._colorList != null )
                _colorList = (Color[]) rhs._colorList.Clone();
            else
                _colorList = null;

            if ( rhs._positionList != null )
            {
                _positionList = (float[]) rhs._positionList.Clone();
            }
            else
                _positionList = null;

            if ( rhs._image != null )
                _image = (Image) rhs._image.Clone();
            else
                _image = null;

            _angle = rhs._angle;
            _wrapMode = rhs._wrapMode;
        }
Exemple #34
0
 static extern bool gimp_drawable_fill(Int32 drawable_ID,
     FillType fill_type);
Exemple #35
0
        /// <summary>
        /// Generic initializer to default values
        /// </summary>
        private void Init()
        {
            _color = Color.White;
            _secondaryValueGradientColor = Color.White;
            _brush = null;
            _type = FillType.None;
            _isScaled = Default.IsScaled;
            _alignH = Default.AlignH;
            _alignV = Default.AlignV;
            _rangeMin = 0.0;
            _rangeMax = 1.0;
            _rangeDefault = double.MaxValue;
            _gradientBM = null;

            _colorList = null;
            _positionList = null;
            _angle = 0;
            _image = null;
            _wrapMode = WrapMode.Tile;
        }
 private static string BuildFillType(FillType fillType)
 {
     return fillType == FillType.Null ? String.Empty : String.Format(QueryStatements.Fill, fillType.ToString().ToLower());
 }
Exemple #37
0
        private void lstFills_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (lstFills.SelectedIndex)
            {
                case 0:
                    fillType = FillType.Uniform;
                    break;

                case 1:
                    fillType = FillType.RadialCircle;
                    break;

                case 2:
                    fillType = FillType.RadialEllipse;
                    break;

                case 3:
                    fillType = FillType.RadialFocal;
                    break;

                case 4:
                    fillType = FillType.LinearVertical;
                    break;

                case 5:
                    fillType = FillType.LinearHorizontal;
                    break;

                case 6:
                    fillType = FillType.LinearForward;
                    break;

                case 7:
                    fillType = FillType.LinearBackward;
                    break;
            }
            if (drawer != null) Draw();
        }
Exemple #38
0
 protected virtual string BuildFillType(FillType fillType)
 {
     return(fillType == FillType.Null ? String.Empty : String.Format(QueryStatements.Fill, fillType.ToString().ToLower()));
 }