The most significant byte of the long integer that is returned by readpixel may be a random value (AFAIK). since you won't need that byte anyway, I'd suggest to mask it out from beginning on:
rgb=ReadPixel(0,0) And $FFFFFF
rgb=ReadPixel(0,0) And $FFFFFF