用vc将 bmp读进去了 但不能显示
代码如下:HBITMAPbmp;BITMAPFILEHEADER*pbmfh;pbmfh=(BITMAPFILEHEADER*)BmpBuf[i];bmp=CreateD...
代码如下:
HBITMAP bmp;
BITMAPFILEHEADER *pbmfh;
pbmfh=(BITMAPFILEHEADER*)BmpBuf[i];
bmp=CreateDIBitmap(pDC->GetSafeHdc(),
(BITMAPINFOHEADER*)(pbmfh+1),
CBM_INIT,
(BYTE*)pbmfh+pbmfh->bfOffBits,
(BITMAPINFO*)(pbmfh+1),
DIB_RGB_COLORS);
BITMAPINFOHEADER *pbminfohead=(BITMAPINFOHEADER*)(pbmfh+1);
pDC->CreateCompatibleDC(0); // 程序运行到这里出错 提示: user breakpoint called form code at 0x7c92120e
pDC->SelectObject(bmp);
pDC->BitBlt(0,0,pbminfohead->biWidth,pbminfohead->biHeight,pDC,0,0,SRCCOPY); 展开
HBITMAP bmp;
BITMAPFILEHEADER *pbmfh;
pbmfh=(BITMAPFILEHEADER*)BmpBuf[i];
bmp=CreateDIBitmap(pDC->GetSafeHdc(),
(BITMAPINFOHEADER*)(pbmfh+1),
CBM_INIT,
(BYTE*)pbmfh+pbmfh->bfOffBits,
(BITMAPINFO*)(pbmfh+1),
DIB_RGB_COLORS);
BITMAPINFOHEADER *pbminfohead=(BITMAPINFOHEADER*)(pbmfh+1);
pDC->CreateCompatibleDC(0); // 程序运行到这里出错 提示: user breakpoint called form code at 0x7c92120e
pDC->SelectObject(bmp);
pDC->BitBlt(0,0,pbminfohead->biWidth,pbminfohead->biHeight,pDC,0,0,SRCCOPY); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询