Exemple #1
0
        //TODO: IMPLEMENT TRANSPARENCY INTO CFRAMES
        public static Coords[] BMPToCoords(string pathToBMP)
        {
            Bitmap bitmap = (Bitmap)Image.FromFile(pathToBMP);

            Coords[] coords = new Coords[bitmap.Width * bitmap.Height];
            for (int x = 0; x < bitmap.Width; x++)
            {
                for (int y = 0; y < bitmap.Height; y++)
                {
                    Color pixel = bitmap.GetPixel(x, y);
                    if (pixel.A == 1)
                    {
                        //nah
                    }
                    else
                    {
                        ConsoleColor consoleColor = NearestConsoleColor.ClosestConsoleColor(pixel.R, pixel.G, pixel.B);
                        coords.Append(new Coords(x, y, ' ', consoleColor, consoleColor));
                    }
                }
            }
            return(coords);
        }