How to display an image loaded from a file on a dialog ?
-
Hello, what I would like to do is to display a logo (jpg or bmp) in a static control on a dialog. This logo will always have the same size and will be stored in a file logo.jpg or logo.bmp located on user station, it will be loaded in the dialog at initialization time (no bitmap stored in the ressources). This will allow me to be more flexible and to customize the dialog for each user station. I will just give each user a different file logo.jpg or logo.bmp. Thanks in advance for any information Regards DD
-
Hello, what I would like to do is to display a logo (jpg or bmp) in a static control on a dialog. This logo will always have the same size and will be stored in a file logo.jpg or logo.bmp located on user station, it will be loaded in the dialog at initialization time (no bitmap stored in the ressources). This will allow me to be more flexible and to customize the dialog for each user station. I will just give each user a different file logo.jpg or logo.bmp. Thanks in advance for any information Regards DD
CStatic::SetBitmap() (or send an STM_SETIMAGE message) and LoadImage with LR_LOADFROMFILE parameter (for BMPs). JPGs you can load with OleLoadPicturePath() and obtain hBmp through IPicture::get_Handle. You can also use IPicture::Render() to draw loaded image.