bmpfile.h

来自「超声影像工作站系统可与各种型号的B超、彩超连接」· C头文件 代码 · 共 30 行

H
30
字号
#define WIDTHBYTES(bits)    (((bits) + 31) / 32 * 4)
#define BMP_HEADERSIZE (3 * 2 + 4 * 12)
#define BMP_BYTESPERLINE (width, bits) ((((width) * (bits) + 31) / 32) * 4)
#define BMP_PIXELSIZE(width, height, bits) (((((width) * (bits) + 31) / 32) * 4) * height)

class BMPFile
{
public:
	// parameters
	CString	m_errorText;
	DWORD	m_bytesRead;

public:
	// operations

	BMPFile();

	BYTE	*LoadBMP(CString fileName, UINT *width, UINT *height);
	void	SaveBMP(CString fileName,		// output path
							BYTE * buf,				// RGB buffer
							UINT width,				// size
							UINT height);
	void	SaveBMP(CString fileName, 			// output path
							 BYTE * colormappedbuffer,	// one BYTE per pixel colomapped image
							 UINT width,
							 UINT height,
 							 int bitsperpixel,			// 1, 4, 8
							 int colors,				// number of colors (number of RGBQUADs)
							 RGBQUAD *colormap);			// array of RGBQUADs 
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?