Esempio n. 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;
        }
Esempio n. 2
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;
        }