In my view class in the onDraw() function, I am drawing the board and filling in the squares as follows:
for (int i = 0; i < 8; i++)
for (int j = 0; j < 8; j++)
COLORREF color = pBC->getSquare(i, j);
int x1 = (j * 70) + 35;
int y1 = (i * -70) - 35;
int x2 = x1 + 70;
int y2 = y1 - 70;
CRect rect(x1, y1, x2, y2);
for (int x = 35; x <= 595; x += 70)
for (int y = -35; y >= -595; y -= 70)
This all works well, and I have my board coming up.
Now I want to draw the chess pieces on the board, and have written some code, just to load 1 bitgmap and display it on the screen. However, nothing gets drawn to the screen. (All I see is just the chessboard)
This is the test code to display my bitmap on the screen:
void CMyChessTestView::drawImage(CDC* pDC, int x, int y)
CBitmap *BmpPrevious = MemDCLady.SelectObject(&BmpLady);
pDC->BitBlt(20, 10, 436, 364, &MemDCLady, 0, 0, SRCCOPY);
The bitmap is not drwan to the screen. I have tried using both the CPaintDC dc or the pDC* but to no avail. I cannot get the bitmap to display.
Any suggestions will be greatly appreciated.