How to get color of a pixel from any Bitmap?

It’s easy to get color of a pixel from a bitmap. Here is a function which does this… [sourcecode language=’cpp’]#include #include // Returns Pixel color from bitmap COLORREF GetPixelValueFromBitmap( const int x, const int y, CBitmap& bmp ) { // DC for desktop CDC dcDesktop; dcDesktop.Attach( ::GetDC( GetDesktopWindow() )); // Create a DC compatible with […]
Continue reading…