Bitmap for dialog background questions
-
I am using a bitmap for a dialog background, which works fine. I am also doing some GDI drawing on top of the bitmap. The problem is updating the GDI drawing causes the bitmap to blink. On a slower computer this may be a major annoyance. The bitmap is loaded in the OnPaint() message handler, where the GDI drawing is also performed and updated. I have tried loading the bitmap image only once, but when the GDI drawing is updated, the bitmap background is erased and not replaced. Is it possible to load the bitmap once, and not have it erased in OnPaint() when the GDI drawing is updated?
-
I am using a bitmap for a dialog background, which works fine. I am also doing some GDI drawing on top of the bitmap. The problem is updating the GDI drawing causes the bitmap to blink. On a slower computer this may be a major annoyance. The bitmap is loaded in the OnPaint() message handler, where the GDI drawing is also performed and updated. I have tried loading the bitmap image only once, but when the GDI drawing is updated, the bitmap background is erased and not replaced. Is it possible to load the bitmap once, and not have it erased in OnPaint() when the GDI drawing is updated?
-
Have you tried to not call default
OnEraseBackground
? Something like that:BOOL CYourDlg::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
// return CDialog::OnEraseBkgnd(pDC);
}Yes, I found that in a book last night, and it works! Thank you