Example #1
0
 public void SetCanvas(RgbCanvas canvas)
 {
     for (int y = 0; y < Height; y++)
     {
         for (int x = 0; x < Width; x++)
         {
             Console.ForegroundColor = canvas.GetPixel(x, y).ToConsoleColor();
             Console.Write(".");
         }
         Console.WriteLine();
     }
 }
Example #2
0
        public void SetCanvasAt(int x, int y, RgbCanvas canvas)
        {
            if (!Validate.InRange(x, y, Width, Height))
            {
                return;
            }

            for (int xOff = x; xOff < Math.Min(Width, canvas.Width); xOff++)
            {
                for (int yOff = y; yOff < Math.Min(Height, canvas.Height); yOff++)
                {
                    SetPixel(xOff, yOff, canvas.GetPixel(xOff - x, yOff - y));
                }
            }
        }
Example #3
0
        public void SetCanvas(RgbCanvas canvas)
        {
            if (Width != canvas.Width || Height != canvas.Height)
            {
                throw new ArgumentException("RgbCanvas must be same size as RgbMatrix", nameof(canvas));
            }

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    SetPixel(x, y, canvas.GetPixel(x, y));
                }
            }
        }