This is question has been really killing me. In XNA when you want to convert an image to color data using Texture.GetData, it only lets you make it a one dimensional array instead of a 2D one. This makes it much more difficult to work with. Is there a specific reason it's like that?

I could only guess that it has something to do with performance when drawing, transforming or manipulating the Texture. Maybe a those actions can be carried out more efficiently in a one dimensional array than a two dimensional one?
–
ChristianJan 4 '13 at 14:07

2 Answers
2

Xna is built uppon Directx and Directx use this strategy cause this is how the the display driver exposes information it gets from the video board. (actually it exposes an array of bytes).
Also to give you a 2d array, the api would need to know the "size" of each texel and the dimensions of you texture to make the conversion. For performance reason, they let the user decide if they want/need to make the conversion.

You can always convert the recovered array in a 2d one. (or you can wrap it in a class that make the coordinate conversion)