如何在vc ++中读取图像文件? [英] How to read the image file in vc++?

查看:102
本文介绍了如何在vc ++中读取图像文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vc ++中读取图像文件?我正在使用FILE指针和读取功能读取整个文件.但是只能读取文件中的第一个NULL字符,其余字符不会被读取.我需要读取整个图像文件以及之间的NULL字符吗?如何执行呢?帮帮我....

How to read the image file in vc++? I am using FILE pointer and fread function to read the entire file. But the reads only upto the first NULL character in the file, the rest of the characters are not being read. I need to read the entire image file along with the NULL characters in between? How to perform this? Help me....

推荐答案

[ ^ ]可能会有所帮助.
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.


这篇关于如何在vc ++中读取图像文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆