Hi i would like to know, how can i get the color of a certain pixel on screen? Like when i am in a game and i press a button on the keyboard it will get what color it is in one specified pixel say... (100, 50)

Thank you so much! I hope this is clear!...

Never tried it myself, but maybe this thread will help you. It contains some source code to call the GetPixel() function.

commented: Push for R2K, you're lagging too far behind +34

Off the top of my head... this should work.

HDC hdc = GetDC( NULL );
COLORREF rgb = GetPixel( hdc, 100, 50 );

Okay thanks a lot! This REALLY helped!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.