CBitmap bitmap;
//加载指定位图资源 Bmp图片ID
bitmap.LoadBitmap(IDB_BITMAP1);
//获取对话框上的句柄 图片控件ID
CStatic *p = (CStatic *)GetDlgItem(IDC_STATIC_PIC);
//设置静态控件窗口风格为位图居中显示
p->ModifyStyle(0xf, SS_BITMAP | SS_CENTERIMAGE);
//将图片设置到Picture控件上
p->SetBitmap(bitmap);
时间: 2024-11-25 11:51:19