作者:小美女爆米花 | 来源:互联网 | 2023-05-18 11:52
hBitmapCreateDIBitmap(pDC->GetSafeHdc(),&pInfo->bmiHeader,CBM_INIT,pData,pInfo,DIB_RGB_
hBitmap= CreateDIBitmap(pDC->GetSafeHdc(),&pInfo->bmiHeader,CBM_INIT, pData,pInfo,DIB_RGB_COLORS);
int i=::GetLastError();
在其他电脑上CreateDIBitmap成功
但在我电脑上CreateDIBitmap失败 而且GetLastError返回0
7 个解决方案
CreateDIBitmap()函数调用失败?GetLastError()函数返回的是0???
CreateDIBitmap 返回NULL GetLastError()返回0 不用怀疑了
只在我电脑上有这个问题哈 其他电脑上没错 说明我代码没问题啊
The DDB that is created will be whatever bit depth your reference DC is. To create a bitmap that is of different bit depth, use CreateDIBSection.
For a device to reach optimal bitmap-drawing speed, specify fdwInit as CBM_INIT. Then, use the same color depth DIB as the video mode.
会不会是你DIB的颜色深度和桌面的设置不一致导致的?