且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在vc ++中读取图像文件?

更新时间:2023-02-14 07:41:46

[ ^ ]可能会有所帮助.
This[^] could help.


确认您已以二进制模式打开文件.您如何检查仅读取数据直到一个空字符?如果将其读取到char数组,则可能会被可视化效果所迷惑.几乎可以肯定,您使用的读取功能会返回读取的字符数.您是否检查过该计数?
Verify you have opened the file in binary mode. How are you checking that the data is only read until a null character? If you read it to a char array, you might get fooled by the visualization. The read function you use almost certainly returns a count of the characters read. Did you examine that count?


您可以将图像文件转换为ASCII格式,然后读取.
You can convert the image file to ASCII format,then read it.