window SDK 在按钮控件 BUTTON 上使用图片
BS_hwnd = CreateWindow ( TEXT("BUTTON"),
L"bitmap1",
WS_CHILD | WS_VISIBLE | BS_BITMAP,//须设为BS_BITMAP
10, 10,
120,40,
hwnd, (HMENU) 1,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
SendMessage(BS_hwnd,
BM_SETIMAGE, //须设为BM_SETIMAGE
(WPARAM) 0,
(LPARAM) LoadImage ( 0, L"C:\\1.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE )//须将图片句柄转为(LPARAM)
);
L"bitmap1",
WS_CHILD | WS_VISIBLE | BS_BITMAP,//须设为BS_BITMAP
10, 10,
120,40,
hwnd, (HMENU) 1,
((LPCREATESTRUCT) lParam)->hInstance, NULL) ;
SendMessage(BS_hwnd,
BM_SETIMAGE, //须设为BM_SETIMAGE
(WPARAM) 0,
(LPARAM) LoadImage ( 0, L"C:\\1.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE )//须将图片句柄转为(LPARAM)
);
以上仅作为学习记录,有错莫怪!