液晶截图例程有问题

[复制链接]
480|0
 楼主| 向日葵的武士 发表于 2019-11-28 18:16 | 显示全部楼层 |阅读模式
计算文件的大小:
例程是这样的: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);

大家觉得小弟说的对不?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

432

主题

439

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部