Exemplo n.º 1
0
 public void FillRectangle(PixColor clr, Rectangle r)
 {
     for (int i = 0; i < r.Height; ++i)
     {
         Console.SetCursorPosition(r.X, r.Y + i);
         char fill = clr.Paint();
         Console.Write("".PadLeft(r.Width - 1, fill));
     }
 }
Exemplo n.º 2
0
        public void drawTestSquare(Rectangle place)
        {
            Color    lastColor = Color.Black;
            PixColor lastUsed  = new PixColor(' ', 0, 0, lastColor);

            for (int j = 0; j < place.Height; j++)
            {
                setCursor(place, j);
                for (int i = 0; i < place.Width; i++)
                {
                    Color pix = Color.FromArgb((int)(255.0 / place.Height * j), (int)(255.0 / place.Width * i), (int)(255.0 / (place.Width * place.Height) * i * j));
                    if (pix != lastColor)
                    {
                        lastUsed = getClosestColor(pix);
                    }

                    lastColor = pix;
                    lastUsed.Paint();
                }
            }
        }