文件名称:C++ 读取bmp图片示例程序
文件大小:3KB
文件格式:RAR
更新时间:2013-09-21 04:29:07
C++ bmp
功能: 读取bmp
代码示例:
typedef struct _bmpsize {
long bmpWidth;//位图宽,单位为象素LONG=long(有符号)
long bmpHeight;//位图高,单位为象素LONG=long(有符号)
unsigned short BitCount;//每个象素所占用的比特位WORD=unsigned short
long BytesPerLine;//位图每行数据所占的字节数LONG=long(有符号)
bool operator ==(_bmpsize bs)
{
if(bmpWidth==bs.bmpWidth
&& bmpHeight==bs.bmpHeight
&& BitCount==bs.BitCount
/*&&BytesPerLine==bs.BytesPerLine*/)
return true;
else
return false;
}
bool operator !=(_bmpsize bs)
{
return !(*this==bs);
}
}BMPSIZE, *LPBMPSIZE;//位图大小信息
class scBmp
{
public:
scBmp();
virtual ~scBmp();
BITMAPFILEHEADER GetBmpFileHeader() const {return m_bmfHeader;};
const char * GetFileName() const {return m_pFileName.GetDataPointer();}
BITMAPINFO * GetBmpInfo() const {return (BITMAPINFO *)m_pbi.GetDataPointer();}
BMPSIZE GetBmpSize() const {return m_bmpSize;}
// scFdmtlType
【文件预览】:
scBmp.h
scBmp.cpp