patapumbum
Programmer
Hy, I am not very familiar with visual c++ and because of this i tried without succes to write a function that can draw into a dialog box, using CClientDC. It looks like this:
void CDesDlg:eseneaza(int x, int y)
{
CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
dcMem.SelectObject(&bmp_patrat);//"bmp_patrat"
//is a CBitmap global variable, previously loaded
dc.BitBlt(x*10, y*10, 10, 10, &dcMem, 0, 0, SRCCOPY);
}
The problem is that it shows the bitmap only once. If I change the coordinates(x and y) it doesn't show anything. 10x.
void CDesDlg:eseneaza(int x, int y)
{
CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
dcMem.SelectObject(&bmp_patrat);//"bmp_patrat"
//is a CBitmap global variable, previously loaded
dc.BitBlt(x*10, y*10, 10, 10, &dcMem, 0, 0, SRCCOPY);
}
The problem is that it shows the bitmap only once. If I change the coordinates(x and y) it doesn't show anything. 10x.