2014年3月15日
摘要: int lImageWidth,lImageHeight,lImageBitCount;BYTE* pImageBuff=NULL;pImageBuff=。。。BuffAddr(); lImageWidth=。。。Width();lImageHeight= 。。。Height(); int outWidth=lImageHeight;int outHeight=lImageWidth;lImageBitCount=8;int nLineWidth=(outWidth+3)/4*4;//凑成大于等于nColumn的最小的4 的整数倍。int size=iImageHeight*nLineWidt 阅读全文
posted @ 2014-03-15 11:22 老能 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 当用SetPixel函数时,for(int j=0;jSetPixel(i,j,RGB(r,g,b)); } }当使用StretchDIBits时要注意显示位图时经典的4字节对齐问题,要求显示每行数据的字节数是4的倍数。当每行的字节数不是4的倍数时,需要对其进行如下处理:有nHeight行,(nWidth+3)/4*4列,然后把imgBits中的像素值,正确的赋值给一个缓冲区imgBufferTemp,最后按imgBufferTemp显示就OK了。BYTE *imgBufferTemp;int nWidthTemp=(nWidth+3)/4*4;imgBufferTemp=new BYTE[n 阅读全文
posted @ 2014-03-15 11:18 老能 阅读(732) 评论(0) 推荐(0) 编辑