读取位图RGB值异常
读取位图RGB值错误!
高手指教错误!
pBits : 没有值!
------解决方案--------------------
你取的位置跑到Bitmap外面了吧。
- C/C++ code
CBitmap bitmap; BITMAP BitMap; if (!bitmap.LoadBitmap(IDB_BITMAP1)) { MessageBox( TEXT("载入失败 ")); } int iRetVal = bitmap.GetBitmap(&BitMap); if(0 == iRetVal) //这里返回0表示错误 { DWORD dwLastError = GetLastError(); //这里获取的错误码 dwLastError++; } int iCount = BitMap.bmWidthBytes * BitMap.bmHeight; char *pBits = new char[iCount]; if(pBits) { bitmap.GetBitmapBits(iCount,pBits); }
高手指教错误!
pBits : 没有值!
------解决方案--------------------
你取的位置跑到Bitmap外面了吧。