Using DirectX 9 and c#, I'm trying to lock a surface so I can manipulate each pixel on the screen.
Surface.Lock() in c# returns a byte[,] (a multidemensional array). Assuming that the array represents the x,y coordinates of the screen I did a little test with my screen set to 800x600 and 8 bit color (8 bit because I can't figure out how to cast byte[,] to int[,]). When I do an incremental fill on the array with different colors, I see that bytearray[320,200] does not equate to the pixel located at 320,200! However, this is what I am lead to believe is true... Any idea why this is not so?
Further explanation:
bytearray[0,0] does equal the upper left of the screen, however bytearray[1,0] equals about a quarter of the way to the right on the x axis!
Does anyone have any suggestions?
Surface.Lock() in c# returns a byte[,] (a multidemensional array). Assuming that the array represents the x,y coordinates of the screen I did a little test with my screen set to 800x600 and 8 bit color (8 bit because I can't figure out how to cast byte[,] to int[,]). When I do an incremental fill on the array with different colors, I see that bytearray[320,200] does not equate to the pixel located at 320,200! However, this is what I am lead to believe is true... Any idea why this is not so?
Further explanation:
bytearray[0,0] does equal the upper left of the screen, however bytearray[1,0] equals about a quarter of the way to the right on the x axis!
Does anyone have any suggestions?