How to save a bitmap in Visual c++ (mfc)?
-
Hi Sakthi here.... Could any one tell me the steps : How to save a bitmap in Visual C++ (mfc)..
The steps.... The good way is to learn how to load them first, reading all about BITMAPINFOHEADER. The information starts from there. That's if you want a learning experience, and wish to become a better programmer. Once you've done that, the lazy (and still good) way is to read articles like: CxImage[^] here on codeproject, in the graphics section. Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
Hi Sakthi here.... Could any one tell me the steps : How to save a bitmap in Visual C++ (mfc)..
HBITMAP hBmp; CBitmap bmp; CBitmap *pOldbmp; BITMAP bi; CDC bmDC; hBmp = (HBITMAP)::LoadImage(NULL,"E:\\Deharadun.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION); if(hBmp==NULL) MessageBox("Bitmap Failed"); bmp.Attach(hBmp); CClientDC dc(this); bmDC.CreateCompatibleDC(&dc); pOldbmp = bmDC.SelectObject(&bmp); bmp.GetBitmap(&bi); dc.BitBlt(0,0,bi.bmWidth,bi.bmHeight,&bmDC,0,0,SRCCOPY); bmDC.SelectObject(pOldbmp); copy same code u can open bitmap file to save bitmap file u have to look for same function as shoown in baove code