The picture control in VC is actually a cstatic type. Once you know this, the first problem is very easy.
Cstatic * PS = (cstatic *) getdlgitem (idc_static); // picture is of the cstatic type
Cbitmap CB;
CB. loadbitmap (idb_testground );
PS-> setbitmap (hbitmap (CB); // convert it to hbitmap forcibly
There is a problem when using this picture control, that is, some controls may be covered by the background image set in picture. The solution is shown on the Internet. The test is successful as follows:
Open the resource file (that is, the. RC file of the project, and find the definition of the corresponding dialog box:
For example:
Idd_picture_dialog dialogex 0, 0,529,400
Style ws_popup | ws_visible
Exstyle ws_ex_appwindow
Font 9, ""
Begin
Control 150, idc_static, "static", ss_bitmap, 533,400
Control "list1", idc_list1, "syslistview32", lvs_report | ws_border |
Ws_tabstop, 27,121,203,162
Control "progress1", idc_progress1, "msctls_progress32", ws_border,
102,320,316, 6, ws_ex_transparent
End
Between this in and end is defined as the control of the dialog box, adjust the positions of these statements, the more at the bottom of the front.
This is a direct method, the fundamental method, but there is a simple method in the operation, is to select all the controls in the editing interface Ctrl + A, and then hold down shift, cancel the selection of the image control, cut and paste the remaining controls so that the image controls are at the bottom layer and the resource files have been changed.
Welcome to my MSN space: http://jkflyfox.spaces.live.com
Areas of interest:. NET development, sqlserver database development, VC development, and wince embedded development
Recently, many development projects have been developed for wince.
For more information, please advise.