"Hooyoo" <zh*********@126.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
>I want to get the color of the specified pixel in the screen.
Firstly I get the position of the cursor:
//Get the position of cursor.
Point position = Cursor.Position;
Next I want to get the color using the position of the cursor.
Anybody here can show me some demo codes?
In addition to what Michael wrote (I'm assuming there's no practical way to
get a Graphics object representing the screen DC in .NET)...
Keep in mind that reading from the video card frame buffer is slow, at least
with AGP cards. So hopefully you don't need to get the pixel's color very
frequently.
Also keep in mind that when an application is using an overlay buffer
(pretty common with video media players, not very common with anything
else), getting the color of a pixel within the overlay will not get the
actual color being displayed there. It will usually be black, but if not it
will be some other default color rather than the pixel you're actually
seeing.
Pete