I am writing a small 2d game engine in C# for my own purposes, and it works fine except for the sprite collision detection. I\'ve decided to make it a per-pixel detection (e
I doubt this is the actual problem, but LockBits doesn't guarantee that the bits data is aligned to the image's Width.
I.e., there may be some padding. You need to access the image using data[x + y * stride] and not data[x + y * width]. The Stride is also part of the BitmapData.