计算文件的大小:
例程是这样的:file_size = (long)Width * (long)Height * 3 + Height*(Width%4) + 54;
个人认为应该是这样的:file_size = (long)((Width + 3)/4 * 4) * (long)Height * 3 + 54;
不是四字节对齐需要补齐:
野火例程是这样的:bmpres = f_write(&bmpfsrc, kk,sizeof(unsigned char)*(Width%4), &mybw);
人认为应该是这样的:bmpres = f_write(&bmpfsrc, kk,sizeof(unsigned char)*(4-(Width%4)), &mybw);
大家觉得小弟说的对不? |