关于VC loadbitmap的问题
voidCOpencv1Dlg::OnButton1(){//TODO:AddyourcontrolnotificationhandlercodehereHBITMAPh...
void COpencv1Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
HBITMAP hBitmap ;
int cxClient, cyClient, cxSource, cySource ;
BITMAP bitmap ;
HDC hdcMem ;
CClientDC hdc(this);
if( LoadBitmap (AfxGetInstanceHandle(), TEXT("NewBeetle"))==NULL )
MessageBox("feel so bad");
GetObject (hBitmap, sizeof (BITMAP), &bitmap) ;
cxSource = bitmap.bmWidth ;
cySource = bitmap.bmHeight;
hdcMem = CreateCompatibleDC (hdc);
SelectObject (hdcMem, hBitmap) ;
BitBlt (hdc, 0, 0, cxSource, cySource, hdcMem, 0, 0, SRCCOPY) ;
DeleteDC (hdcMem) ;
}
在对话框的这个响应中,需要load一个bitmap,可是返回值总是NULL,不成功 展开
{
// TODO: Add your control notification handler code here
HBITMAP hBitmap ;
int cxClient, cyClient, cxSource, cySource ;
BITMAP bitmap ;
HDC hdcMem ;
CClientDC hdc(this);
if( LoadBitmap (AfxGetInstanceHandle(), TEXT("NewBeetle"))==NULL )
MessageBox("feel so bad");
GetObject (hBitmap, sizeof (BITMAP), &bitmap) ;
cxSource = bitmap.bmWidth ;
cySource = bitmap.bmHeight;
hdcMem = CreateCompatibleDC (hdc);
SelectObject (hdcMem, hBitmap) ;
BitBlt (hdc, 0, 0, cxSource, cySource, hdcMem, 0, 0, SRCCOPY) ;
DeleteDC (hdcMem) ;
}
在对话框的这个响应中,需要load一个bitmap,可是返回值总是NULL,不成功 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询