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

Parse() public method

public Parse ( Stream input ) : void
input Stream
return void
        public void Parse( Stream input )
        {
            BitStream bits = new BitStream( input );

            if ( _HasScale = ( 1 == bits.GetBits( 1 ) ) )
            {
                _numScaleBits = (byte)bits.GetBits( 5 );
                bits.GetBitsFB( _numScaleBits, out _xScaleF );
                bits.GetBitsFB( _numScaleBits, out _yScaleF );
            }
            if ( _HasRotate = ( 1 == bits.GetBits( 1 ) ) )
            {
                _numRotateBits = (byte)bits.GetBits( 5 );
                bits.GetBitsFB( _numRotateBits, out _rotateSkew0F );
                bits.GetBitsFB( _numRotateBits, out _rotateSkew1F );
            }
            _numTranslateBits = ( byte )bits.GetBits( 5 );
            _translateX = bits.GetBitsSigned( _numTranslateBits );
            _translateY = bits.GetBitsSigned( _numTranslateBits );
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        public virtual void Parse( Stream input )
        {
            BitStream bits = new BitStream( input );

            uint reserved = bits.GetBits( 2 );
            if ( 0 != reserved )
            {
                throw new SwfFormatException( "ButtonRecord reserved bits used" );
            }

            _ButtonHasBlendMode = ( 0 != bits.GetBits( 1 ) );
            _ButtonHasFilterList = ( 0 != bits.GetBits( 1 ) );
            _ButtonStateHitTest = ( 0 != bits.GetBits( 1 ) );
            _ButtonStateDown = ( 0 != bits.GetBits( 1 ) );
            _ButtonStateOver = ( 0 != bits.GetBits( 1 ) );
            _ButtonStateUp = ( 0 != bits.GetBits( 1 ) );

            BinaryReader br = new BinaryReader( input );

            _CharacterID = br.ReadUInt16();
            _PlaceDepth = br.ReadUInt16();
            _PlaceMatrix = new Matrix( this.Version );
            _PlaceMatrix.Parse( input );
        }