I am trying to use the getPixel API to to get the color value of a pixel on the active screen. The code works fine for several minutes and then the screen goes all screwy and the program crashes. I have searched the net for any known problems with the getpixel API, but have not found any reference to the API crashing the program. If I copy the screen to a picture box, I don't have the problem, but it takes quite a long time to bitblt a screen to a picture box, more time than my program can stand.
Does anyone know of this problem using getpixel? Is there a fix for it?
Is there any way to sync the getpixel call with the screen refresh rate?