Esempio n. 1
0
        public void ReadRGBATest()
        {
            var mem = new MemoryStream();
            mem.WriteByte(0x0a);
            mem.WriteByte(0xff);
            mem.WriteByte(0x83);
            mem.WriteByte(0x12);
            mem.Seek(0, SeekOrigin.Begin);
            var reader = new SwfStreamReader(mem);
            var val = reader.ReadRGBA();
            Assert.AreEqual(0x0a, val.Red, "Red");
            Assert.AreEqual(0xff, val.Green, "Green");
            Assert.AreEqual(0x83, val.Blue, "Blue");
            Assert.AreEqual(0x12, val.Alpha, "Alpha");

            Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream");
        }
Esempio n. 2
0
        public void ReadRGBATest()
        {
            var mem = new MemoryStream();

            mem.WriteByte(0x0a);
            mem.WriteByte(0xff);
            mem.WriteByte(0x83);
            mem.WriteByte(0x12);
            mem.Seek(0, SeekOrigin.Begin);
            var reader = new SwfStreamReader(mem);
            var val    = reader.ReadRGBA();

            Assert.AreEqual(0x0a, val.Red, "Red");
            Assert.AreEqual(0xff, val.Green, "Green");
            Assert.AreEqual(0x83, val.Blue, "Blue");
            Assert.AreEqual(0x12, val.Alpha, "Alpha");

            Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream");
        }