Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不知道为什么,但第一个像素(左下角)加载正确,但其他像素不会加载,第一个颜色用于整个图片......
我有这个循环
fread(&pix,sizeof(pix),1,pictureIn); fwrite(&pix,sizeof(pix),1,pictureOut);
编辑:
pix 是三个无符号字符(rgb)的结构,加载文件和信息头似乎没问题
您使用的是什么操作系统?我最近在 Win32 下读取二进制文件时遇到问题。原来我忘记将“b”标志传递给fopen:
pictureIn = fopen ("in.bmp", "rb"); pictureOut = fopen ("out.bmp", "wb");