CompatibleDC parameter question
-
Hi, I have a question, situation like:
void funcA()
{
CDC MemDC;
CDC *pDC ;
pDC = GetDC();
memDC.CreateCompatibleDC(pDC);funcB(memDC);
}void funcB(CDC *pDC)
{
HDC hdc;
HDC hdcMem;hdc = pDC->m_hDC;
hdcMem = CreateCompatibleDC(hdc);
...
BitBlt(hdc,0,0,100,100,hdcMem,0,0,SRCCOPY);
}I think this BitBlt() will copy hdcMem to MemDC(in FuncA), right? just want to confirm it.
-
Hi, I have a question, situation like:
void funcA()
{
CDC MemDC;
CDC *pDC ;
pDC = GetDC();
memDC.CreateCompatibleDC(pDC);funcB(memDC);
}void funcB(CDC *pDC)
{
HDC hdc;
HDC hdcMem;hdc = pDC->m_hDC;
hdcMem = CreateCompatibleDC(hdc);
...
BitBlt(hdc,0,0,100,100,hdcMem,0,0,SRCCOPY);
}I think this BitBlt() will copy hdcMem to MemDC(in FuncA), right? just want to confirm it.
-
I want funcB draw picture on it's own temporary DC, then paste on funcA's memory DC, and FuncA paste the whole funcA's DC to screen. Like: B -> A c -> A ... x -> A and A -> screen. And I had another question, I have a big bitmap, represent the screen, many parts of the bitmap need to update independently and frequently. is it a good idea using one memory DC to hold all part's temporary DC, then post the whole memory DC to screen? that is, the double buffering technique.
-
I want funcB draw picture on it's own temporary DC, then paste on funcA's memory DC, and FuncA paste the whole funcA's DC to screen. Like: B -> A c -> A ... x -> A and A -> screen. And I had another question, I have a big bitmap, represent the screen, many parts of the bitmap need to update independently and frequently. is it a good idea using one memory DC to hold all part's temporary DC, then post the whole memory DC to screen? that is, the double buffering technique.
-
1. Sounds OK. What happens when you try it? 2. Yes, keeping a MemDC with all the information and then updating that, before blitting to screen is probably the best way.