private void RenderImage(Image image) { Point loc = image.AbsoluteLocation(); RenderBackgroundBox( loc, image.Size, image.BackgroundColor ); if (image.UseColors) { ConsoleColor previousColor = image.UseInvertedColors ? ConsoleAdapter.BackgroundColor : ConsoleAdapter.BackgroundColor; for (int y = 0; y < image.Size.Height; ++y) { for (int x = 0; x < image.Size.Width; x++) { ConsoleAdapter.MoveCursor(x + loc.Left, y + loc.Top); if (image.UseInvertedColors) { ConsoleAdapter.BackgroundColor = image.ImageArray[y, x].Color; ConsoleAdapter.ForegroundColor = image.ForegroundColor; } else { ConsoleAdapter.ForegroundColor = image.ImageArray[y, x].Color; } ConsoleAdapter.Write(image.ImageArray[y, x].Char); } } ConsoleAdapter.ForegroundColor = previousColor; } else { for (int y = 0; y < image.Size.Height; ++y) { for (int x = 0; x < image.Size.Width; x++) { ConsoleAdapter.MoveCursor(x + loc.Left, y + loc.Top); ConsoleAdapter.Write(image.ImageArray[y, x].Char); } } } }