Beispiel #1
0
 private void Init(byte[] data)
 {
     for (int i = 0; i < this.palettes.Length; i++)
     {
         byte[] paletteData = Palettes.GetPaletteData(data, i);
         this.palettes[i] = new Palette(this, i, paletteData);
         this.palettes[i].ColorChanged  += this.palette_ColorsChanged;
         this.palettes[i].ColorsChanged += this.palette_ColorsChanged;
     }
 }
Beispiel #2
0
        public void SetBytes(byte[] data)
        {
            if (data.Length != Palettes.Size)
            {
                throw new ArgumentException($"Palettes data should have a size of {Palettes.Size} bytes. Actual: {data.Length} bytes.", nameof(data));
            }

            int count = data.Length / Palette.Size;

            for (int i = 0; i < count; i++)
            {
                byte[] paletteData = Palettes.GetPaletteData(data, i);
                this.palettes[i].SetBytes(paletteData);
            }
        }