1个回答
展开全部
要用到StretchBlt()函数
大致代码如下:
HBITMAP bit;//位图句柄
HDC dc1;//兼容DC
//读取未土资源并返回其句柄
bit=::LoadBitmap(AfxGetApp()->m_hinstance,MAKEINTRESOURCE(IDB_BITMAP1));
//创建与位图资源相兼容的设备DC
dc1::CreateCompatibleDC(::GetDC(::GetDlgItem(this->m_hWnd,IDC_TUPIAN));
//将位图资源句柄选入设备兼容DC中
::SelectObject(dc1,bit);
//调用API函数将兼容DC中的位图赋值到目标DC
::StretchBlt(::GetDC(::GetDlgItem(this->m_hWnd,IDC_TUPIAN)),1,1,450,80,dc1,0,0,400,330,SRCCOPY);
大致代码如下:
HBITMAP bit;//位图句柄
HDC dc1;//兼容DC
//读取未土资源并返回其句柄
bit=::LoadBitmap(AfxGetApp()->m_hinstance,MAKEINTRESOURCE(IDB_BITMAP1));
//创建与位图资源相兼容的设备DC
dc1::CreateCompatibleDC(::GetDC(::GetDlgItem(this->m_hWnd,IDC_TUPIAN));
//将位图资源句柄选入设备兼容DC中
::SelectObject(dc1,bit);
//调用API函数将兼容DC中的位图赋值到目标DC
::StretchBlt(::GetDC(::GetDlgItem(this->m_hWnd,IDC_TUPIAN)),1,1,450,80,dc1,0,0,400,330,SRCCOPY);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询