Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC8.0
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 15-May-11 19:22pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This[^] could help.
  Permalink  
Comments
Olivier Levrey at 16-May-11 7:46am
   
Yes it could. 5.
Abhinav S at 16-May-11 7:54am
   
Thank you.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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?
  Permalink  
Comments
Olivier Levrey at 16-May-11 7:44am
   
Good advice. 5.
Niklas Lindquist at 16-May-11 13:40pm
   
Merci!
Olivier Levrey at 17-May-11 3:29am
   
De rien ;)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can convert the image file to ASCII format,then read it.
  Permalink  
Comments
Olivier Levrey at 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)

  Print Answers RSS
0 OriginalGriff 390
1 Jochen Arndt 150
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,260


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 16 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100