using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;

namespace individual
{
    public partial class Form1 : Form
    {
        Individual[] test;
        int size = 20, index = 0;
        public Form1()
        {
            InitializeComponent();
            test = new Individual[size];
            for (int i = 0; i < size; i++)
            {
                test[i] = new Individual(picture.Width, picture.Height);
            }
            //test = new Individual(picture.Width, picture.Height);

            picture.Image = test[0].TheImage; //do this instead
        }

        private void btnClick(object sender, EventArgs e)
        {
            //Console.WriteLine("click, before");
            //Console.WriteLine(test.TheImage.ToString());
            //test = new Individual(picture.Width, picture.Height);
            if(index < size)
            {
                picture.Image = test[index].TheImage; //do this instead
                index++;
            }
           

            //Invalidate();
        }

        //DO NOT USE!!!
        private void paint(object sender, PaintEventArgs e)
        {
            //Console.WriteLine("in paint, before");
            //Console.WriteLine(test.TheImage.ToString());
            //e.Graphics.DrawImage(test.TheImage, 0, 0);
            //Console.WriteLine("in paint, after");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (index < size)
            {
                picture.Image = test[index].TheImage; //do this instead
                index++;
            }
        }
    }
}
