예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WaveFormatEx"/> class.
 /// </summary>
 /// <param name="reader">The binary stream reader.</param>
 public WaveFormatEx(BoxBinaryReader reader)
 {
     this.FormatTag      = reader.ReadInt16();
     this.Channels       = reader.ReadInt16();
     this.SamplesPerSec  = reader.ReadInt32();
     this.AvgBytesPerSec = reader.ReadInt32();;
     this.BlockAlign     = reader.ReadInt16();
     this.BitsPerSample  = reader.ReadInt16();
     this.Size           = reader.ReadInt16();
     if (this.Size > 0)
     {
         this.ExtendedData = reader.ReadBytes(this.Size);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WaveFormatEx"/> class.
 /// </summary>
 /// <param name="reader">The binary stream reader.</param>
 public WaveFormatEx(BoxBinaryReader reader)
 {
     this.FormatTag = reader.ReadInt16();
     this.Channels = reader.ReadInt16();
     this.SamplesPerSec = reader.ReadInt32();
     this.AvgBytesPerSec = reader.ReadInt32(); ;
     this.BlockAlign = reader.ReadInt16();
     this.BitsPerSample = reader.ReadInt16();
     this.Size = reader.ReadInt16();
     if (this.Size > 0)
     {
         this.ExtendedData = reader.ReadBytes(this.Size);
     }
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BitmapInfonHeader"/> class.
        /// </summary>
        /// <param name="reader">The box binary reader.</param>
        public BitmapInfonHeader(BoxBinaryReader reader)
        {
            var initialOffset = reader.Offset;

            this.Size            = reader.ReadInt32();
            this.Width           = reader.ReadInt32();
            this.Height          = reader.ReadInt32();
            this.Planes          = reader.ReadInt16();
            this.BitCount        = reader.ReadInt16();
            this.Compression     = reader.ReadString(4);
            this.ImageSize       = reader.ReadInt32();
            this.XPixelsPerMeter = reader.ReadInt32();
            this.YPixelsPerMeter = reader.ReadInt32();
            this.ColorsUsed      = reader.ReadInt32();
            this.ColorsImportant = reader.ReadInt32();

            this.CodecPrivateData = reader.ReadBytes(this.Size - (int)(reader.Offset - initialOffset));
        }