怎样用MFC编程将BMP图像文件显示出来
2016-07-13
展开全部
代码 大概就是这样 有几个关键函数仔细一下,要是要完整代码呢留言
CDC memDC;
CBitmap memBitmap,*pOldBitmap;
CWindowDC dc(GetDesktopWindow());
memDC.CreateCompatibleDC(&dc);
int nWidth,nHeight;
/* nWidth=GetSystemMetrics(SM_CXSCREEN);
nHeight=GetSystemMetrics(SM_CYSCREEN);*/
CRect rect;
GetDesktopWindow()->GetWindowRect(rect);
ClientToScreen(&rect);
nWidth=rect.Width();
nHeight=rect.Height();
memBitmap.CreateCompatibleBitmap(&dc,nWidth,nHeight);
pOldBitmap=memDC.SelectObject(&memBitmap);
// memDC.StretchBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,rect.Width(),rect.Height(),SRCCOPY);
memDC.BitBlt(0,0,nWidth,nHeight,&dc,0,0,SRCCOP
CDC memDC;
CBitmap memBitmap,*pOldBitmap;
CWindowDC dc(GetDesktopWindow());
memDC.CreateCompatibleDC(&dc);
int nWidth,nHeight;
/* nWidth=GetSystemMetrics(SM_CXSCREEN);
nHeight=GetSystemMetrics(SM_CYSCREEN);*/
CRect rect;
GetDesktopWindow()->GetWindowRect(rect);
ClientToScreen(&rect);
nWidth=rect.Width();
nHeight=rect.Height();
memBitmap.CreateCompatibleBitmap(&dc,nWidth,nHeight);
pOldBitmap=memDC.SelectObject(&memBitmap);
// memDC.StretchBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,rect.Width(),rect.Height(),SRCCOPY);
memDC.BitBlt(0,0,nWidth,nHeight,&dc,0,0,SRCCOP
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询