www.pudn.com > JingXiang-Design-Jeff.rar > bmpdef.h


#ifndef _XRH_BMPDEF_H_ 
#define _XRH_BMPDEF_H_ 
#pragma pack(1) 
/*            Some structures for bmp files  
											 
								Written by Xuronghai&lizijian,2000-04-24 
 
                                                 */  
/*===============================================================================*/ 
/* 
                                         BMP File Sturct 
 
                              Offset 0: BMP Head info   -->BITMAPFILEHEADER 
									    BMP Info Struct	-->BITMAPINFOHEADER 
										Color Map       -->RGBQUAD 
                   		Offset  bfSize: Image Data                    
							              
 
 
 
 
 
*/ 
///////////////////////////////////////////////////////////////////////// 
 
typedef struct { 
	           WORD  bfType;     //it Must be 'BM' 
			   DWORD bfSize;     // Size of the BMP file 
			   WORD  bfReserved1;// Reserved For later 
			   WORD  bfReserved2;// must be zero  
			   DWORD bfOffBits;  // offset of block of graphic data from head (bytes)  
								 // Some thing for bfOffBits's Value: 
			                      
								//	Mode              Value 
							    //   2 colors	       3F h 
	           		 			//	 16 colors		   76 h	 
								//	256 colors        436 h			 
								//	Ture Color		   36 h		 
				                  
 
}BMPFileHeader; 
 
typedef struct{ 
	           DWORD biSize;          //Size of this structure,often be 28h 
			   DWORD biWidth;         //width  of the image,pixels 
			   DWORD biHeight;        //height of the image,pixels 
			   WORD  biPlanes;        //Num of the plane of image,Must be 1 
			   WORD  biBitCount;      //how many bits for 1 pixel,must be 1,4,8 or 24 
			   DWORD biCompression;   // define image compressed, 0 no compressed 
									  //						  1 RLE_8  RUN Length Encoding 8  
				          			  //                          2 RLE_4  RUN Length Encoding 4  
			                           									 
			   DWORD biSizeImage;      //Size of image data 
			   DWORD biXPelsPerMeter;  // How many pixels in X direction 1 meter 
			   DWORD biYPelsPerMeter;  // How many pixels in Y derection 1 meter 
			   DWORD biClrUsed;        // Num of colors this image used,if 0,用的颜色数等于颜色表颜色总数 
			   DWORD biClrImportant;   // Num of Important colors,if 0, Every Color be Important       
}BMPInfoHeader; 
 
 
typedef struct{ 
	          BYTE rgbBlue; 
			  BYTE rgbGreen; 
			  BYTE rgbRed; 
			  BYTE Reserved; 
			   
}RGBQuad; 
 
 
/* 
#define BMPFileHeader BITMAPFILEHEADER 
#define BMPInfoHeader BITMAPINFOHEADER 
#define RGBQuad       RGBQUAD 
*/ 
#endif