You're not going to believe how I "solved" it.
Code: Select all
if (SourceMaskArray[i] >= index) SourceImageArray[i-(int)(i/Width)] = 0;
Apparently you have to substact the row number, the images are the exact same size, maybe they marshal.copy is uhm.. bad?
But it only solves the problem for the problem-pictures, the good ones are messed up in same way now (so I'll have to figure out a way to determine whether a picture is good or not)
And there are those that need 2 or 3 times the row-number substracted.
But I guess this narrows down the problem to uhm.. well to what? It defenitly has something to do with not-matching widths.. Even if the pictures have the same size..