编程自己做网站,推广公众号的9种方法,2022年一建停考最新消息,驻马店网站建设当前位置:我的异常网 VC/MFC 怎么将24位色BMP图片改为单色或16色#xff1f;怎么将24位色BMP图片改为单色或16色#xff1f;(2)www.myexceptions.net 网友分享于#xff1a;2013-01-10 浏览#xff1a;432次GetClientRect(hWnd,rc);Width rc.righ…当前位置:我的异常网» VC/MFC » 怎么将24位色BMP图片改为单色或16色怎么将24位色BMP图片改为单色或16色(2)www.myexceptions.net 网友分享于2013-01-10 浏览432次GetClientRect(hWnd,rc);Width rc.right-rc.left;Height rc.bottom-rc.top;}hDC GetDC(hWnd); //获取指定的DChMemDC CreateCompatibleDC(hDC);hBitmap CreateCompatibleBitmap(hDC, Width, Height);hTmpBmp CreateCompatibleBitmap(hDC, 8, 8);pBmInfoMem (LPBITMAPINFO)GlobalAlloc(GHND, sizeof(BITMAPINFO)256*sizeof(RGBQUAD));pBmInfo (LPBITMAPINFO)GlobalLock(pBmInfoMem);SelectObject(hMemDC, hBitmap);BitBlt(hMemDC,0,0,Width,Height,hDC,0,0,SRCCOPY);SelectObject(hMemDC, hTmpBmp);ZeroMemory(pBmInfo, sizeof(BITMAPINFO));pBmInfo- bmiHeader.biSize (DWORD)sizeof(BITMAPINFOHEADER);pBmInfo- bmiHeader.biWidth Width;pBmInfo- bmiHeader.biHeight Height;pBmInfo- bmiHeader.biPlanes 1;pBmInfo- bmiHeader.biBitCount (WORD)GetDeviceCaps(hDC, BITSPIXEL);pBmInfo- bmiHeader.biCompression BI_RGB;//pBmInfo- bmiHeader.biCompression BI_RLE8;GetDIBits(hDC, hBitmap, 0,Height, NULL, pBmInfo, DIB_RGB_COLORS);文章评论