Exemple #1
0
        public SwfHeader(SwfReader r)
        {
            this.Signature0 = r.GetByte();

            if (this.Signature0 == 'C')
            {
                this.IsCompressed = true;
                r.DecompressSwf();
            }
            else
            {
                this.IsCompressed = false;
            }

            this.Signature1 = r.GetByte();
            this.Signature2 = r.GetByte();

            this.IsSwf = (Signature2 == 'S') && (Signature1 == 'W') && ((Signature0 == 'C') || (Signature0 == 'F'));

            if (IsSwf)
            {
                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;
            }
        }
Exemple #2
0
        public SwfHeader(SwfReader r)
        {
            this.Signature0 = r.GetByte();

            if (this.Signature0 == 'C')
            {
                this.IsCompressed = true;
                r.DecompressSwf();
            }
            else
            {
                this.IsCompressed = false;
            }

            this.Signature1 = r.GetByte();
            this.Signature2 = r.GetByte();

            this.IsSwf = (Signature2 == 'S') && (Signature1 == 'W') && ((Signature0 == 'C') || (Signature0 == 'F'));

            if (IsSwf)
            {
                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;
            }
        }