Exemplo n.º 1
0
		public SpriteFileHeader(File file)
		{
			if (file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(33);
			if (data.Length != 33) throw new ArgumentException("File is not long enough", "file");

			m_signature = System.Text.Encoding.Default.GetString(data, 0, 11);
			m_version = new Drawing.SpriteFileVersion(data[12], data[13], data[14], data[15]);
			m_numberofgroups = BitConverter.ToInt32(data, 16);
			m_numberofimages = BitConverter.ToInt32(data, 20);
			m_subheaderoffset = BitConverter.ToInt32(data, 24);
			m_subheadersize = BitConverter.ToInt32(data, 28);
			m_sharedpalette = data[32] > 0;
		}
Exemplo n.º 2
0
        public SpriteFileHeader(File file)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file");
            }

            Byte[] data = file.ReadBytes(33);
            if (data.Length != 33)
            {
                throw new ArgumentException("File is not long enough", "file");
            }

            m_signature       = System.Text.Encoding.Default.GetString(data, 0, 11);
            m_version         = new Drawing.SpriteFileVersion(data[12], data[13], data[14], data[15]);
            m_numberofgroups  = BitConverter.ToInt32(data, 16);
            m_numberofimages  = BitConverter.ToInt32(data, 20);
            m_subheaderoffset = BitConverter.ToInt32(data, 24);
            m_subheadersize   = BitConverter.ToInt32(data, 28);
            m_sharedpalette   = data[32] > 0;
        }