Why does my SetDIBColorTable fail ?
-
The return value for my SetDIBColorTable() function call is 0 (zero), so the function failed . Why ? Here's the source code : HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, m_handlerToBMP); RGBQUAD pColors[256]; //RGBQUAD *oldpColors; for(int i=0; i<256; ++i) { pColors[i].rgbRed = i; pColors[i].rgbBlue = i; pColors[i].rgbGreen = i; pColors[i].rgbReserved = 0; } //pColors1=pColors; //GetDIBColorTable(hMemDC, 0, 256, oldpColors); UINT aaa=SetDIBColorTable(hMemDC,0,255,pColors);
-
The return value for my SetDIBColorTable() function call is 0 (zero), so the function failed . Why ? Here's the source code : HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, m_handlerToBMP); RGBQUAD pColors[256]; //RGBQUAD *oldpColors; for(int i=0; i<256; ++i) { pColors[i].rgbRed = i; pColors[i].rgbBlue = i; pColors[i].rgbGreen = i; pColors[i].rgbReserved = 0; } //pColors1=pColors; //GetDIBColorTable(hMemDC, 0, 256, oldpColors); UINT aaa=SetDIBColorTable(hMemDC,0,255,pColors);