BMPFILE.h
资源名称:Visualhk.rar [点击查看]
上传用户:cjw5120
上传日期:2022-05-11
资源大小:5032k
文件大小:1k
源码类别:
网络截获/分析
开发平台:
Visual C++
- #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
- };