Question : Load BitMaps into a "Picture Control in MFC Dynamically

I have a "Picture Control in my dialog, named ID is IDC_MYPICS.  i want the User to be able to select their perferred Bitmaps and I will save that selection's address (Ex: c:\My Pics") into the program's databases so that when the program runs their selected bitmaps will be shown.
How can I do this?
     1) show steps for retrieving their selections MFC code ONLY)
     2) show code for inserrting those bitmaps into the picture control(ie, IDC_MYPICS")

Answer : Load BitMaps into a "Picture Control in MFC Dynamically

Of course a Static control can display color images. The article focuses on a specific situation (creating a monochrome bitmap from raw data) that you need not worry about.

The genral technique certainly does work. Follow the steps 1-4. To get the HBITMAP that you will use in your call to
    m_ctlBmp.SetBitmap( hBmp );

Use this function:
LoadImage http://msdn.microsoft.com/en-us/library/ms648045(VS.85).aspx

For instance:

1:
2:
3:
HBITMAP hBmp= (HBITMAP)LoadImage(
    0, "c:\\temp\\any.bmp", IMAGE_BITMAP, 0,0, LR_LOADFROMFILE
);
Random Solutions  
 
programming4us programming4us