The way how object like lines and shapes get filled.
Inheritance: AbstractSwfElement
Example #1
0
 /// <summary>
 /// LINESTYLE2 builds upon the capabilities of the LINESTYLE record by allowing the use of new types of joins 
 /// and caps as well as scaling options and the ability to fill a stroke.
 /// </summary>
 /// <param name="InitialVersion">The version of the Swf file using this object.</param>
 public LineStyle2(byte InitialVersion)
     : base(InitialVersion)
 {
     this._startCapStyle = CapStyle.None;
     this._joinstyle = JoinStyle.Round;
     this._endCapStyle = CapStyle.None;
     this._color = new Rgba(this._SwfVersion);
     this._fillStyle = new FillStyle(this._SwfVersion);
 }
Example #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public virtual void Parse( Stream input, TagTypes caller )
        {
            BinaryReader br = new BinaryReader(input);

            this._fillStyleCount = br.ReadByte();

            if (this._fillStyleCount.Equals(0xFF))
            {
                if (caller.Equals(TagTypes.DefineShape2) || caller.Equals(TagTypes.DefineShape3))
                {
                    this._fillStyleCountExtended = br.ReadUInt16();

                    //Log.InfoFormat("{0}(0x{0:x4}) fillstyles will be parsed", (int)this._fillStyleCountExtended);

                    for (UInt16 i = 0; i < this._fillStyleCountExtended; i++)
                    {
                        FillStyle temp = new FillStyle(this._SwfVersion);
                        try
                        {
                            temp.Parse(input, caller);
                            this._fillStyles.Add(temp);
                        }
                        catch (SwfFormatException e)
                        {
                           Log.Error(this, e.Message);
                        }
                    }
                }
                else
                {
                    SwfFormatException e = new SwfFormatException("Extended count of fill styles supported only for Shape2 and Shape3.");
                   Log.Error(this, e.Message);
                    throw e;
                }
            }
            else
            {
                //Log.InfoFormat("{0}(0x{0:x4}) fillstyles will be parsed", (int)this._fillStyleCount);

                for (byte i = 0; i < this._fillStyleCount; i++)
                {
                    FillStyle temp = new FillStyle(this._SwfVersion);
                    try
                    {
                        temp.Parse(input, caller);
                    }
                    catch (SwfFormatException e)
                    {
                        throw e;
                    }

                    this._fillStyles.Add( temp);
                }
            }
        }