Load Bitmap at Dialog background in an MFC application

Explain the way to load Bitmap at Dialog background within an MFC application?

E

Expert

Verified

Within OnInit Dialog:

1. Create CBitmap through the bitmap.
2. Generate a memory DC ( as CDC)
3. Place the CBitmap in the memory DC (utilize CDC::SelectObject function)
Within OnPaint:
4. Find your dialog DC (as CDialog::GetDC)
5. Do StretchBlt or BitBlt on dialog DC along with memory DC as source DC (it will paint the bitmap upon your dialog).
6. Release dialog DC (by ReleaseDC function)

   Related Questions in Financial Management

©TutorsGlobe All rights reserved 2022-2023.