Firstly, is my logic about how much space this array will take up correct?
bool[,] b = new bool[8192 /* 8 * 1024 = 1KB */, 20]; // 20KB
I wish to render a given section of a 2D array to the window. The array is of bools and represents a 2 color image. The image should take up the whole window and each pixel should be sharp\pixelated as opposed to there being interpolation\gradients between the pixels centers.
For example (there will ofc be more encapsulation than this):
draw(bool[,] b,
float top_left_x, float top_left_y, float width, float height,
float false_red, float false_green, float false_blue,
float true_red, float true_green, float true_blue)
{
// what goes here?
}
Is there anything build into c#\XNA to do this efficiently?
You could do the same thing as opposed here: How to draw 2D pixel-by-pixel in XNA?
The only thing you have to do is check which color will get into your texture for if it is true or false.