예제 #1
0
        static void Basic_Gif_v1(string img_path, bool use_read = false, int image_width = 237, int image_height = 69)
        {
            RGB_picker picker = new RGB_picker();

            picker.Set_img_path(img_path);
            picker.Set_size(image_width, image_height);
            var colors = picker.Colors_Changed_Console_Color_gif();

            Drawer drawer = new Drawer();

            if (use_read == true)
            {
                System.Console.WriteLine("Ready");
                System.Console.Read();
                System.Console.Clear();
            }


            foreach (var item in colors)
            {
                for (int x = 0; x < picker.ConsoleColor_X; x++)
                {
                    for (int y = 0; y < picker.ConsoleColor_Y; y++)
                    {
                        drawer.Color_Write(x, y, item[x, y]);
                    }
                }
            }

            System.Console.SetCursorPosition(0, picker.ConsoleColor_Y + 1);
            System.Console.ForegroundColor = ConsoleColor.Black;
        }
예제 #2
0
        static void Basic(string img_path)
        {
            RGB_picker picker = new RGB_picker();

            picker.Set_img_path(img_path);
            picker.Set_size(237, 69);
            ConsoleColor[,] colors = picker.Colors_Changed_Console_Color();

            Drawer drawer = new Drawer();
        }
예제 #3
0
        static void Basic_v2(string img_path, bool use_read = false, bool chaos = false, int chaos_times = 500, int image_width = 237, int image_height = 69)
        {
            RGB_picker picker = new RGB_picker();

            picker.Set_img_path(img_path);
            picker.Set_size(image_width, image_height);
            ConsoleColor[,] colors = picker.Colors_Changed_Console_Color();

            Drawer drawer = new Drawer();

            List <int> xl = new List <int>();
            List <int> yl = new List <int>();

            for (int i = 0; i < picker.ConsoleColor_X; i++)
            {
                xl.Add(i);
            }
            for (int i = 0; i < picker.ConsoleColor_Y; i++)
            {
                yl.Add(i);
            }
            Shuffle <int> shuffle = new Shuffle <int>();

            shuffle.Shuffle_List(xl);
            shuffle.Shuffle_List(yl);

            if (use_read == true)
            {
                System.Console.WriteLine("Ready");
                System.Console.Read();
                System.Console.Clear();
            }

            if (chaos == true)
            {
                drawer.Chaos_line(chaos_times, false, 0, picker.ConsoleColor_X, 0, picker.ConsoleColor_Y);
            }

            foreach (var x in xl)
            {
                foreach (var y in yl)
                {
                    drawer.Color_Write(x, y, colors[x, y]);
                }
            }

            System.Console.SetCursorPosition(0, picker.ConsoleColor_Y + 1);
            System.Console.ForegroundColor = ConsoleColor.Black;
        }
예제 #4
0
        static void Basic_v4(string img_path, bool use_read = false, bool chaos = false, int add_chaos_times = 0, int image_width = 237, int image_height = 69)
        {
            RGB_picker picker = new RGB_picker();

            picker.Set_img_path(img_path);
            picker.Set_size(image_width, image_height);
            ConsoleColor[,] colors = picker.Colors_Changed_Console_Color();

            List <Vector2> xylists = new List <Vector2>();

            for (int x = 0; x < picker.ConsoleColor_X; x++)
            {
                for (int y = 0; y < picker.ConsoleColor_Y; y++)
                {
                    xylists.Add(new Vector2(x, y));
                }
            }
            Shuffle <Vector2> shuffle = new Shuffle <Vector2>();

            shuffle.Shuffle_List(xylists);

            Drawer drawer = new Drawer();

            if (use_read == true)
            {
                System.Console.WriteLine("Ready");
                System.Console.Read();
                System.Console.Clear();
            }

            if (chaos == true)
            {
                drawer.Chaos_Write(add_chaos_times, false, 0, picker.ConsoleColor_X, 0, picker.ConsoleColor_Y);
            }

            foreach (var item in xylists)
            {
                drawer.Color_Write((int)item.X, (int)item.Y, colors[(int)item.X, (int)item.Y]);
            }
            System.Console.SetCursorPosition(0, picker.ConsoleColor_Y + 1);
            System.Console.ForegroundColor = ConsoleColor.Black;
        }
예제 #5
0
        static void Basic_Gif_v4(string img_path, bool use_read = false, bool use_delay = false, bool use_black_screen = false, int image_width = 237, int image_height = 69)
        {
            RGB_picker picker = new RGB_picker();

            picker.Set_img_path(img_path);
            picker.Set_size(image_width, image_height);
            var colors = picker.Colors_Changed_Console_Color_gif();

            Drawer drawer = new Drawer();

            if (use_read == true)
            {
                System.Console.WriteLine("Ready");
                System.Console.Read();
                System.Console.Clear();
            }


            for (int frame = 0; frame < colors.Count; frame++)
            {
                List <Vector2> xylists = new List <Vector2>();
                for (int x = 0; x < picker.ConsoleColor_X; x++)
                {
                    for (int y = 0; y < picker.ConsoleColor_Y; y++)
                    {
                        xylists.Add(new Vector2(x, y));
                    }
                }

                Shuffle <Vector2> shuffle = new Shuffle <Vector2>();
                shuffle.Shuffle_List(xylists);

                foreach (var item2 in xylists)
                {
                    if (frame == 0)
                    {
                        drawer.Color_Write((int)item2.X, (int)item2.Y, colors[frame][(int)item2.X, (int)item2.Y]);
                    }
                    else
                    {
                        if (colors[frame][(int)item2.X, (int)item2.Y] != colors[frame - 1][(int)item2.X, (int)item2.Y])
                        {
                            drawer.Color_Write((int)item2.X, (int)item2.Y, colors[frame][(int)item2.X, (int)item2.Y]);
                        }
                    }
                }
                if (use_delay == true)
                {
                    foreach (var item2 in xylists)
                    {
                        if (frame == 0)
                        {
                            drawer.Color_Write((int)item2.X, (int)item2.Y, colors[frame][(int)item2.X, (int)item2.Y]);
                        }
                        else
                        {
                            if (colors[frame][(int)item2.X, (int)item2.Y] != colors[frame - 1][(int)item2.X, (int)item2.Y])
                            {
                                drawer.Color_Write((int)item2.X, (int)item2.Y, colors[frame][(int)item2.X, (int)item2.Y]);
                            }
                        }
                    }
                }

                if (use_black_screen == true)
                {
                    foreach (var item2 in xylists)
                    {
                        drawer.Color_Write((int)item2.X, (int)item2.Y, System.Console.BackgroundColor);
                    }
                    if (use_delay == true)
                    {
                        foreach (var item2 in xylists)
                        {
                            drawer.Color_Write((int)item2.X, (int)item2.Y, System.Console.BackgroundColor);
                        }
                    }
                }
            }

            System.Console.SetCursorPosition(0, picker.ConsoleColor_Y + 1);
            System.Console.ForegroundColor = ConsoleColor.Black;
        }