示例#1
0
        public override void Draw(int x, int y, IPixel pixel = null)
        {
            if (pixel == null)
            {
                pixel = new ConsolePixel();
            }
            var p = pixel as ConsolePixel;

            if (x >= 0 && x < ScreenWidth && y >= 0 && y < ScreenHeight)
            {
                bufScreen[y * ScreenWidth + x].UnicodeChar = p.PIXEL_TYPE;
                bufScreen[y * ScreenWidth + x].Attributes  = p.COLOUR;
            }
        }
示例#2
0
 public override void Fill(int x1, int y1, int x2, int y2, IPixel pixel = null)
 {
     if (pixel == null)
     {
         pixel = new ConsolePixel();
     }
     Clip(ref x1, ref y1);
     Clip(ref x2, ref y2);
     for (int x = x1; x < x2; x++)
     {
         for (int y = y1; y < y2; y++)
         {
             Draw(x, y, pixel);
         }
     }
 }