window SDK 使用静态控件 STATIC 显示图片
BS_hwnd = CreateWindow ( TEXT("STATIC"),
L"bitmap1",
WS_CHILD | WS_VISIBLE | SS_BITMAP,//SS_BITMAP表示图片
10, 10,
0, 0,
hwnd, (HMENU) 1,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
SendMessage(BS_hwnd,
STM_SETIMAGE, //必须发送STM_SETIMAGE
(WPARAM) 0,
(LPARAM) LoadImage ( 0, L"C:\\1.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE )//获取图片句柄,并转换为(LPARAM)
);
L"bitmap1",
WS_CHILD | WS_VISIBLE | SS_BITMAP,//SS_BITMAP表示图片
10, 10,
0, 0,
hwnd, (HMENU) 1,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
SendMessage(BS_hwnd,
STM_SETIMAGE, //必须发送STM_SETIMAGE
(WPARAM) 0,
(LPARAM) LoadImage ( 0, L"C:\\1.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE )//获取图片句柄,并转换为(LPARAM)
);
其它的,可查查离线版MSDN,个人认为。:)