I'm working on a project to show a 2D world generation process in steps using bitmap images. Array data is stored in this way:
Main.tile[i, j].type = x;
With x being an integer value >= 0.
Basically i and j are changed every time the program loops using for-loops, and the following statement is run after certain conditions are met during the loop process at the end of the loop. So, a possible sequence could be:
Main.tile[4, 67].type = 1;
Main.tile[4, 68].type = 1;
Main.tile[4, 69].type = 0;
And so on.
I tried several methods of directly modifying the bitmap image once the array was changed/updated (using Bitmap.SetPixel), but this seemed way to slow to be useful for a 21k,8k pixel resoltion bitmap.
I'm looking for a way to digest the whole array at the end of the whole looping process (not after each individual loop, but between steps), and put colored points (depending on the value of the array) accordingly to i, j (as if it were a coordinate system).
Are there any faster alternatives to SetPixel, or are there easier ways to save an array to a bitmap/image file?