4bpp bit setting problem

  • Thread starter Thread starter James Dean
  • Start date Start date
J

James Dean

I set the first 4 index values of the colorpalette to the following:
0 = white;
1 = red;
2 = blue;
3 = OverlapColor(mix of red and blue);

So the first 4 bits will be used to to set one pixel.....so if i want to
set it to red for instance i set the byte to a value of 1..........if i
want to set the following pixel to red also i add the value 16 to the
byte so two pixels side by side will have a byte value of 17.....4bits
for each pixel.....first 4 bits is 1 second is 16......
Unfortunately this does not work for some reason..could somebody please
tell me how to set each 4bit pixel to get the correct value....i seem to
be able to set the first 4 bits allright but not the second 4 bits.....
is first 4 bits
0,1,2,4,8 then second 4 bits are 16,32,64 and 128......but which bits do
i turn on?....
 
Back
Top