Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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....
Posted

This[^] could help.
 
Share this answer
 
Comments
Olivier Levrey 16-May-11 7:46am    
Yes it could. 5.
Abhinav S 16-May-11 7:54am    
Thank you.
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?
 
Share this answer
 
Comments
Olivier Levrey 16-May-11 7:44am    
Good advice. 5.
Niklas L 16-May-11 13:40pm    
Merci!
Olivier Levrey 17-May-11 3:29am    
De rien ;)
You can convert the image file to ASCII format,then read it.
 
Share this answer
 
Comments
Olivier Levrey 16-May-11 7:43am    
I don't see how this could help...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900