public Texture2D getTexture()
        {
            byte[]       buffer = PyNet.DecompressBytes(Data);
            MemoryStream stream = new MemoryStream(buffer);
            BinaryReader reader = new BinaryReader(stream);

            Color[] colors = new Color[Width * Height];

            for (int i = 0; i < colors.Length; i++)
            {
                var r = reader.ReadByte();
                var g = reader.ReadByte();
                var b = reader.ReadByte();
                var a = reader.ReadByte();
                colors[i] = new Color(r, g, b, a);
            }

            Texture2D texture = null;

            if (IsScaled)
            {
                byte[]       sbuffer = PyNet.DecompressBytes(ScaledData);
                MemoryStream sstream = new MemoryStream(sbuffer);
                BinaryReader sreader = new BinaryReader(sstream);
                Color[]      scolors = new Color[ScaledWidth * ScaledHeight];

                for (int i = 0; i < scolors.Length; i++)
                {
                    var sr = sreader.ReadByte();
                    var sg = sreader.ReadByte();
                    var sb = sreader.ReadByte();
                    var sa = sreader.ReadByte();
                    scolors[i] = new Color(sr, sg, sb, sa);
                }

                Texture2D stexture = new Texture2D(Game1.graphics.GraphicsDevice, ScaledWidth, ScaledHeight);
                stexture.SetData(scolors);

                texture = new ScaledTexture2D(Game1.graphics.GraphicsDevice, Width, Height, stexture, Scale, (ForcedSourceRectangle.Length > 0 && ForcedSourceRectangle[0] != -1) ? new Rectangle?(new Rectangle(ForcedSourceRectangle[0], ForcedSourceRectangle[1], ForcedSourceRectangle[2], ForcedSourceRectangle[3])) : null);
            }
            else
            {
                texture = new Texture2D(Game1.graphics.GraphicsDevice, Width, Height);
            }

            texture.SetData(colors);

            return(texture);
        }
        public Texture2D getTexture()
        {
            byte[]       buffer = PyNet.DecompressBytes(Data);
            MemoryStream stream = new MemoryStream(buffer);
            BinaryReader reader = new BinaryReader(stream);

            Color[] colors = new Color[Width * Height];

            for (int i = 0; i < colors.Length; i++)
            {
                var r = reader.ReadByte();
                var g = reader.ReadByte();
                var b = reader.ReadByte();
                var a = reader.ReadByte();
                colors[i] = new Color(r, g, b, a);
            }

            Texture2D texture = new Texture2D(Game1.graphics.GraphicsDevice, Width, Height);

            texture.SetData(colors);
            return(texture);
        }