1. 加载 BMP
- CStatic* pWnd = (CStatic*)GetDlgItem(IDC_PIC); // 得到 Picture Control 句柄
- pWnd->ModifyStyle(0, SS_BITMAP); // 修改它的属性为位图
- pWnd->SetBitmap((HBITMAP)::LoadImage(NULL, _T("bmp.bmp"),
- IMAGE_BITMAP,
- 100,
- 50,
- LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE));
- CStatic* pWnd = (CStatic*)GetDlgItem(IDC_PIC); // 得到 Picture Control 句柄
- CImage image;
- image.Load(_T("png.png");
- HBITMAP hBmp = image.Detach();
- pWnd->SetBitmap(hBmp);
- pWnd->SetWindowPos(NULL,
- 0,
- 0,
- 100,
- 50,
- SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
原文: http://hi.baidu.com/beachfish%CA%B7%D3%F1%CB%A7/blog/item/8addb204c5e93e9be850cd7b.html