Use GetTextColor! Function signature is as follows… [sourcecode language=’cpp’] // MFC COLORREF GetTextColor() const; // SDK COLORREF GetTextColor( HDC hdc ); // handle to DC[/sourcecode]
Continue reading…
Posts tagged with 'COLORREF'
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…