示例#1
0
 internal SwfHeader(SwfReader r)
 {
     this.CompressionMode  = CompressionType.Error;
     this.CompressionRatio = 0;
     //byte[] __signature = r.GetBytes(3);
     this.Signature = r.GetString(3);
     //Signature = r.GetString(3);
     if (Signature == "CWS")
     {
         this.CompressionMode = CompressionType.ZLIB;
         uint __oldSize = r.Size;
         r.DecompressCWSSwf();
         uint __newSize = r.Size;
         this.CompressionRatio = ((double)__oldSize / (double)__newSize) * 100;
     }
     else if (Signature == "ZWS")
     {
         this.CompressionMode = CompressionType.LZMA;
         //r.DecompressZWSSwf
         uint __oldSize = r.Size;
         r.DecompressCWSSwf();
         uint __newSize = r.Size;
         this.CompressionRatio = (double)__oldSize / (double)__newSize;
     }
     else if (Signature == "FWS")
     {
         this.CompressionMode = CompressionType.None;
     }
     if (this.CompressionMode != CompressionType.Error)
     {
         this.Version    = r.GetByte();
         this.FileLength = r.GetUI32();
         this.FrameSize  = new Rect(r);
         UInt16 __frate = r.GetUI16();
         this.FrameRate  = (__frate >> 8) + ((__frate & 0xFF) / 0xFF);
         this.FrameCount = r.GetUI16();
     }
     else
     {
         this.Version    = 0;
         this.FileLength = 0;
         this.FrameSize  = new Rect(0, 0, 0, 0);
         this.FrameRate  = 0;
         this.FrameCount = 0;
     }
 }