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 Message to limit the size of window?

0 Answers  


what is the stack size in win 32 program

0 Answers  


Explain Win32 Program Execution flow?

0 Answers  


About GDI object?

2 Answers  


how radio button is active in dialog box?

1 Answers  


what is the difference between MFC and Win32

5 Answers   ArisGlobal, Microsoft,


What is System call executable binary file into a process?

0 Answers  


What is preemption and context switching?

0 Answers  


System call executable binary file into a process

2 Answers  


what are the design patterns of an MFC application

5 Answers   Samsung, SunSoft Technologies,


sql query for delete duplicate records in sql datadbase

0 Answers  


win 3.1 supports which type of multi tasking?

2 Answers   TISL,


Categories