Click to See Complete Forum and Search --> : 2 questions on basics of DIB bitmaps in C++


quietcoder
June 26th, 2002, 03:25 AM
I'm using Dev-C++ 4.
question one: How do I create a DIB bitmap in memory?

question two: How do I save it to the hard drive?

sandodo
June 26th, 2002, 04:51 AM
If you can search the msdn of microsoft vc++, you can find what i attached. hope these files help you.
they implemented the read, save and display the dib and bmp files

quietcoder
June 26th, 2002, 11:22 AM
well it almost worked. except i don't have an stdafx.h file. at first compile there was only one error that the stdafx.h file was not found, after remarking that line out it produced 31 errors. The header files with the letters dib that i have are:

winuser.h
cguid.h
mciavi.h
mmsystem.h
olectlid.h
winerror.h
wingdi.h
d3dxcore.h
GLAUX.H

sandodo
June 26th, 2002, 09:36 PM
the sample code is used under the envioroment of VC++.
And the afxstd.h is a standard MFC header which is automatically generated when the MFC project is created.
If your dev c++ doesnot support it, you have to modify the related classes accordingly, but the structure of the sample code can be reused.

For example CFile CPalette. You have to relplace CFile with FILE and use the hPalette instead of CPalette. I am not familar with dev c++, so you should know how to translate.

The HDIB handler is declared vy using DECALRE_HANDLE which is included in "mmsystem.h" the HPalette is included in "wingdi.h". :cool: