Ejemplo n.º 1
0
 public DesignPattern()
 {
     Image   = new byte[(Width / 2) * Height];
     Palette = new Color[15];
     for (int i = 0; i < 15; i++)
     {
         Palette[i] = new DesignPattern.Color();
     }
 }
    public ACNHFileFormat(byte[] bytes)
    {
        Version   = bytes[0];
        Name      = System.Text.Encoding.Unicode.GetString(bytes, 1, 0x29).Replace(" ", "").Trim();
        Palette   = new DesignPattern.Color[15];
        this.Type = (DesignPattern.TypeEnum)bytes[0x2B];
        for (int i = 0; i < 15; i++)
        {
            Palette[i] = new DesignPattern.Color()
            {
                R = bytes[0x2C + i * 3 + 0], G = bytes[0x2C + i * 3 + 1], B = bytes[0x2C + i * 3 + 2]
            }
        }
        ;
        this.Pixels = new byte[Width / 2 * Height];
        Array.Copy(bytes, 0x59, this.Pixels, 0, this.Pixels.Length);
    }
}