Example #1
0
 /// <summary>
 ///     Renders the control and all contained controls
 /// </summary>
 /// <returns>The rendered pixels</returns>
 public override Pixel[,] Render()
 {
     Pixel[,] tmp = new Pixel[Size.Height, Size.Width];
     tmp.Populate(new Pixel(BackColor, ForeColor, SpecialChars.Empty));
     if (Border)
     {
         for (int i = 0; i < Size.Width; i++)
         {
             tmp[Size.Height - 1, i] = new Pixel(BackColor, ForeColor, SpecialChars.OneLineSimple.LeftRight);
         }
         for (int i = 0; i < Size.Height; i++)
         {
             tmp[i, Size.Width - 1] = new Pixel(BackColor, ForeColor, SpecialChars.OneLineSimple.UpDown);
         }
         tmp[Size.Height - 1, Size.Width - 1] = new Pixel(BackColor, ForeColor, '┘');
     }
     foreach (Control control in Controls)
     {
         if (control.Visible)
         {
             Pixel[,] render = control.Render();
             render.CopyTo(tmp, control.Point);
         }
     }
     return(tmp);
 }