How to load Bitmap at Dialogbakground in an MFC application?



How to load Bitmap at Dialogbakground in an MFC application?..

Answer / john k gummadi

In OnInitDialog:
-----------------
1. Create CBitmap from the bitmap.
2. Create a memory DC (CDC)
3. Put the CBitmap into the memory DC (Use
CDC::SelectObject function).


In OnPaint:
------------
4. Get your dialog DC (CDialog::GetDC)
5. Do BitBlt or StretchBlt on dialog DC with memory DC as
source DC (this will paint the bitmap on your dialog).
6. Release dialog DC (ReleaseDC function)

Is This Answer Correct ?    13 Yes 0 No

Post New Answer

More Win32API Interview Questions

What is Win32?

14 Answers   AAA, Genpact, HCL, Wipro,


About GDI object?

2 Answers  


What is preemption ? context switching ?

3 Answers  


how radio button is active in dialog box?

1 Answers  


Message to limit the size of window

3 Answers  






how to Initialize contents of a dialog?

2 Answers   TCS,


What is GDI object?

0 Answers  


what is the function to repaint a window immediately?

2 Answers  


explain WM_PAINT message ?????

0 Answers  


write About send message and post message

4 Answers  


How will we unable and disable services in win 7 ?

2 Answers   McAfee, Microsoft,


what is use of the createWindow object

4 Answers   HCL,


Categories