Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            int imageHeight = image.GetHeight();
            int imageWidth  = image.GetWidth();

            int stepY = imageHeight / 45;
            int stepX = imageWidth / 150;

            CalculateBorderValues(stepX, stepY);

            OutputChars(imageHeight, imageWidth, stepY, stepX, image, CharsByDarkness, min, max);

            Console.ReadLine();
        }
Ejemplo n.º 2
0
        public static void GoThroughImageHeightAndWidth(ExtendedImage image, int stepX, int stepY, int min, int max, out int min2, out int max2)
        {
            for (int y = 0; y < image.GetHeight(); y += stepY)
            {
                for (int x = 0; x < image.GetWidth(); x += stepX)
                {
                    int sum = 0;

                    sum = GetSum(image, stepX, stepY, x, y, min, max, sum);

                    sum = sum / stepY / stepX;
                    if (max < sum)
                    {
                        max = sum;
                    }

                    if (min > sum)
                    {
                        min = sum;
                    }
                }
            }

            min2 = min;
            max2 = max;
        }
Ejemplo n.º 3
0
        public static void GoThroughImageHeightAndWidth(ExtendedImage image, int stepX, int stepY, int min2, int max2, char[] charsByDarkness)
        {
            for (int y = 0; y < image.GetHeight() - stepY; y += stepY)
            {
                for (int x = 0; x < image.GetWidth() - stepX; x += stepX)
                {
                    int sum = 0;

                    sum = GetSum(image, stepX, stepY, x, y, min2, max2, sum);

                    sum = sum / stepY / stepX;
                    Console.Write(charsByDarkness[(sum - min2) * charsByDarkness.Length / (max2 - min2 + 1)]);
                }

                Console.WriteLine();
            }
        }