For what you're doing it sounds like you want to find the distances in x and y direction, then loop over whichever is larger (say delta_x > delta_y) - this to limit rounding errors - and then step off in that direction, "stepping up" when you've gone delta_x/delta_y pixels (might be a -1 needed somewhere in these formulas - too early for creative thinking) .

But I believe this is susceptible to the problem in my last post, in case the pixels you're checking has been determined by some other function. If you're merely painting pixels in a line between 2 points, this should work OK...

/Michael
_________________________
/Michael