Please help
-
i was wondering if it would be possible to load a bitmap image into a dialog-based application, to be displayed like a logo for a window and if so, possibly how i would go about doing so.
go to the top (of most) CodeProject pages, key 'bitmap' into the search field, Set the selector to 'Articles', press the Enter Key you should see quite a few articles on bitmaps etc - find the one that most suits your needs and experiment with it when you have an issue, post back a specific question with some code, rather than a 'help me' or 'please help' ..
-
i was wondering if it would be possible to load a bitmap image into a dialog-based application, to be displayed like a logo for a window and if so, possibly how i would go about doing so.
Here's one way (I assume you want to load from a file): 1. Add a picture control to the dialog, be sure to set its type to "bitmap". Change to ID to something meaningful. 2. Using the ClassWizard add a member variable of type
CStatic
for the control, call itm_Picture
. 3. Add the following to your class declaration:HBITMAP m_hBM;
4. Add the following code to the dialog'sOnInitDialog
handler:HBITMAP m_hBM = reinterpret_cast<HBITMAP>( LoadImage( NULL, _T("C:\\130x130.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE ) ); m_Picture.SetBitmap(m_hBM);
5. Add the following in a
WM_DESTROY
handler:DeleteObject(m_hBM);
Steve