Hi all! I'm new to pixel/graphic management and fairly new to C# as well but i'm learning some AI at the same time, very basic of course.
I did some kind of "Game of life", you know that it imitates cell birth and death and whatnot.
I have it working in a listview that i update a few times in a second so i can follow the simulation. I think i'm ready for the next step and i'm thinking on making a graphical representation of it instead of letters.
I'm probably implementing a 2D array, each cell will represent an actual cell for example like 0-death, 1-changing, 2-stablished...something like that. I think i want each cell to be represented by a pixel or maybe four pixels so it's not that tiny thing.
I just learnt a little bit about Bitmaps and how to draw them first and then put them on a picture box. I have this example:
System.Drawing.Bitmap flag = new System.Drawing.Bitmap(10, 10);
for (int x = 0; x < flag.Height; ++x)
for (int y = 0; y < flag.Width; ++y)
flag.SetPixel(x, y, Color.White);
for (int x = 0; x < flag.Height; ++x)
flag.SetPixel(x, x, Color.Red);
pictureBox1.Image = flag;
Since i'm going to refresh that array and thus refreshing the bitmap, thus refreshing the picturebox, i wonder if there's a fastest/better way to do this.
On the other hand i want to know what would be the best way to convert those cells in the array into some icons that i can make. Instead of using coloured pixels.
Thank you!
PS: excuse my poor english.