I am learning the ropes of Visual C++. I want to load a bitmap file(DIB), find out individual raw pixel values(RGB) and process. I am understanding bitmap,palettes etc. I have tried:
if (nColors > 256)
pOldPalette = pDC->SelectPalette (m_palette, FALSE);
CBitmap* pOldBitmap = memDC.SelectObject (pBitmap);
Would this give me the accurate pixel values? Independent of palette, if at all it is necessary. Thanks in regards,
GetPixel() will return a COLORREF data type. You can then get 3 values (Red, Green, and Blue) using the following formula:
The low-order byte will contain the Red value, the second byte is for green, and the third byte contains a value for blue.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)