I also had this problem in the past. I resorted to using LineDDA and the callback process.
struct LineData{
CDC* pDC;
COLORREF crForegroundColor;
COLORREF crBackgroundColor;
};
.
.
.
LineData* pData = new LineData;
pData->crForegroundColor = crForegroundColor;
pData->crBackgroundColor = crBackgroundColor;
pData->pDC = pdc;
LineDDA(nStartx, nStarty, nEndPointX, nEndPointY, LineDDAProc, (LPARAM) pData);
delete pData;
.
.
.
void
LineDDAProc(int x, int y, LPARAM lpData)
{
static short nTemp = 0;
LineData* pData = (LineData*) lpData;
if (nTemp == 1)
pData->pDC->SetPixel(x, y, pData->crForegroundColor);
else
pData->pDC->SetPixel(x, y, pData->crBackgroundColor);
nTemp = (nTemp + 1) % 2;
}
, , . , , , -. setpixel 'on'. .