Recurity.Swf.GradRecord.Parse C# (CSharp) Method

Parse() public method

public Parse ( Stream input, TagTypes caller ) : void
input Stream
caller TagTypes
return void
        public void Parse( Stream input, TagTypes caller )
        {
            BinaryReader br = new BinaryReader(input);
            this._ratio = br.ReadByte();

            if (caller.Equals(TagTypes.DefineShape3) || caller.Equals(TagTypes.DefineShape4))
            {
                this._color = new Rgba(this._SwfVersion);
                this._color.Parse(input);
            }
            else
            {
                this._color = new Rgb(this._SwfVersion);
                this._color.Parse(input);
            }
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <param name="caller"></param>
        public override void Parse( Stream input, TagTypes caller )
        {
            BitStream bits = new BitStream( input );

            this._spreadMode = ( SpreadMode )bits.GetBits( 2 );
            this._interpolationMode = ( InterPolation )bits.GetBits( 2 );
            this._numGradients = ( byte )bits.GetBits( 4 );

            bits.Reset();

            GradRecord temp = new GradRecord(this._SwfVersion);

            for ( int i = 0; i < _numGradients; i++ )
            {
                temp = new GradRecord( this._SwfVersion );
                temp.Parse( input, caller );
                this._gradientRecords.Add(temp);
            }

            bits.GetBitsFB( 16, out this._focalPoint );
        }