コード例 #1
0
        /// <summary>
        /// Load data from byte array into structure
        /// </summary>
        public void loadDataStructure(byte[] dataIN)
        {
            BytesManipulation myEnc = new BytesManipulation();

            // Fill data in the structure
            _wFormatTag = (short)myEnc.GetIntFromBytes(dataIN,0,2) ;
            _nChannels = (short)myEnc.GetIntFromBytes(dataIN,2,2) ;
            _nSamplesPerSec = (int)myEnc.GetIntFromBytes(dataIN,4,4) ;
            _nAvgBytesPerSec = (int)myEnc.GetIntFromBytes(dataIN,8,4) ;
            _nBlockAlign = (short)myEnc.GetIntFromBytes(dataIN,12,2) ;
            _wBitsPerSample = (short)myEnc.GetIntFromBytes(dataIN,14,2);

            // Extra
            if (dataIN.Length > 16)
            {
                _cbSize = (short)myEnc.GetIntFromBytes(dataIN,16,2) ;
            }

            if (dataIN.Length > 18)
            {
                _wID = (short)myEnc.GetIntFromBytes(dataIN,18,2) ;
            }

            if (dataIN.Length > 20)
            {
                _fdwFlags = (int)myEnc.GetIntFromBytes(dataIN,20,4) ;
            }

            if (dataIN.Length > 24)
            {
                _nBlockSize = (short)myEnc.GetIntFromBytes(dataIN,24,2) ;
            }

            if (dataIN.Length > 26)
            {
                _nFramesPerBlock = (short)myEnc.GetIntFromBytes(dataIN,26,2) ;
            }

            if (dataIN.Length > 28)
            {
                _nCodecDelay = (short)myEnc.GetIntFromBytes(dataIN,28,2) ;
            }

            return;
        }
コード例 #2
0
        /// <summary>
        /// Load data from byte array into structure
        /// </summary>
        public void loadDataStructure(byte[] dataIN)
        {
            BytesManipulation myEnc = new BytesManipulation();

            // Fill data in the structure
            _fccType = (int)myEnc.GetIntFromBytes(dataIN,0,4) ;
            _fccHandler = (int)myEnc.GetIntFromBytes(dataIN,4,4) ;
            _dwFlags = (int)myEnc.GetIntFromBytes(dataIN,8,4) ;
            _wPriority = (ushort)myEnc.GetIntFromBytes(dataIN,12,2) ;
            _wLanguage = (ushort)myEnc.GetIntFromBytes(dataIN,14,2) ;
            _dwInitialFrames = (int)myEnc.GetIntFromBytes(dataIN,16,4) ;
            _dwScale = (int)myEnc.GetIntFromBytes(dataIN,20,4) ;
            _dwRate = (int)myEnc.GetIntFromBytes(dataIN,24,4) ;
            _dwStart = (int)myEnc.GetIntFromBytes(dataIN,28,4) ;
            _dwLength = (int)myEnc.GetIntFromBytes(dataIN,32,4) ;
            _dwSuggestedBufferSize = (int)myEnc.GetIntFromBytes(dataIN,36,4) ;
            _dwQuality = (int)myEnc.GetIntFromBytes(dataIN,40,4) ;
            _dwSampleSize = (int)myEnc.GetIntFromBytes(dataIN,44,4);
            _left = (ushort)myEnc.GetIntFromBytes(dataIN,48,2) ;
              	_top = (ushort)myEnc.GetIntFromBytes(dataIN,50,2) ;
            _right = (ushort)myEnc.GetIntFromBytes(dataIN,52,2) ;
            _bottom = (ushort)myEnc.GetIntFromBytes(dataIN,54,2) ;

            return;
        }
コード例 #3
0
        /// <summary>
        /// Load data from byte array into structure
        /// </summary>
        public void loadDataStructure(byte[] dataIN)
        {
            BytesManipulation myEnc = new BytesManipulation();

            // Fill data in the structure
            _dwMicroSecPerFrame = (int)myEnc.GetIntFromBytes(dataIN,0,4) ;
            _dwMaxBytesPerSec = (int)myEnc.GetIntFromBytes(dataIN,4,4) ;
            _dwPaddingGranularity = (int)myEnc.GetIntFromBytes(dataIN,8,4) ;
            _dwFlags = (int)myEnc.GetIntFromBytes(dataIN,12,4) ;
            _dwTotalFrames = (int)myEnc.GetIntFromBytes(dataIN,16,4) ;
            _dwInitialFrames = (int)myEnc.GetIntFromBytes(dataIN,20,4) ;
            _dwStreams = (int)myEnc.GetIntFromBytes(dataIN,24,4) ;
            _dwSuggestedBufferSize = (int)myEnc.GetIntFromBytes(dataIN,28,4) ;
            _dwWidth = (int)myEnc.GetIntFromBytes(dataIN,32,4) ;
            _dwHeight = (int)myEnc.GetIntFromBytes(dataIN,36,4) ;
            _dwReserved0 = (int)myEnc.GetIntFromBytes(dataIN,40,4) ;
            _dwReserved1 = (int)myEnc.GetIntFromBytes(dataIN,44,4) ;
            _dwReserved2 = (int)myEnc.GetIntFromBytes(dataIN,48,4) ;
            _dwReserved3 = (int)myEnc.GetIntFromBytes(dataIN,52,4) ;
            return;
        }
コード例 #4
0
        /// <summary>
        /// Load data from byte array into structure
        /// </summary>
        public void loadDataStructure(byte[] dataIN)
        {
            BytesManipulation myEnc = new BytesManipulation();

            // Fill data in the structure
            _biSize = (int)myEnc.GetIntFromBytes(dataIN,0,4) ;
            _biWidth = (int)myEnc.GetIntFromBytes(dataIN,4,4) ;
            _biHeight = (int)myEnc.GetIntFromBytes(dataIN,8,4) ;
            _biPlanes = (short)myEnc.GetIntFromBytes(dataIN,12,2) ;
            _biBitCount = (short)myEnc.GetIntFromBytes(dataIN,14,2) ;
            _biCompression = (int)myEnc.GetIntFromBytes(dataIN,16,4) ;
            _biSizeImage = (int)myEnc.GetIntFromBytes(dataIN,20,4) ;
            _biXPelsPerMeter = (int)myEnc.GetIntFromBytes(dataIN,24,4) ;
            _biYPelsPerMeter = (int)myEnc.GetIntFromBytes(dataIN,28,4) ;
            _biClrUsed = (int)myEnc.GetIntFromBytes(dataIN,32,4) ;
            _biClrImportant = (int)myEnc.GetIntFromBytes(dataIN,36,4) ;
            return;
        }