I am experiencing some difficulty changing the colors of a bitmap. For each pixel of a bitmap I am assigning it a shade of blue based on its horizontal placement. The function is similar to
x: Position from 0 to bitmap.width - 1.
v: Variation in color [0 to 255].
n: Maximum number of colors [0 to 255].
The expected bitmap begins with columns of low intensity blue that progress to high intensity blue and then repeat. However, sometimes there are diagonal columns or no columns, and there are also pixels with shades of just red or just green. From what i have seen it appears that the first part of each row is being misplaced somehow and that the cutoff is not happening at a pixel boundry, resulting in other colors. To further complicate matters, the behavior does not appear if I use pixel.blue = 200 (or any other constant) and is also dependant on the values of v, n, and bitmap.width.
I have included the mini project that I am using to try to understand the problem. Thank you for your help.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.