Esempio n. 1
0
 public void SetTile(Tile value)
 {
     for (byte x = 0; x < Width; x++)
     {
         for (byte y = 0; y < Height; y++)
         {
             pixels[x, y].BackColor = PaletteUtility.GetColor((Palette)value.Data[x, y]);
         }
     }
 }
Esempio n. 2
0
        void Init()
        {
            byte c = 0;

            //set the colours
            for (byte x = 0; x < Width; x++)
            {
                for (byte y = 0; y < Height; y++)
                {
                    pixels[x, y].BackColor = PaletteUtility.GetColor((Palette)(c++));
                }
            }

            var p = pixels[0, 0];

            p.ForeColor = Color.Red;
            p.Paint    += (s, e) =>
            {
                e.Graphics.DrawLine(Pens.Red, 0, 0, p.Width, p.Height);
                e.Graphics.DrawLine(Pens.Red, p.Width - 2, 0, 0, p.Height - 2);
            };
        }