Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C graphics TurboC
I have a grey scale image. Now I need to retrieve the pixel value and write in a text file using C code. I need those value for compressing the image. Previously I used MATLAB for that purpose. But presently I need C code for the same.
Posted 5-May-10 0:00am
Edited 13-May-10 1:44am
Moak11.4K
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

While it is possible using Turbo C for such a purpose, why don't you use a more recent compiler? Visual C++ Express Edition is available for free, for instance.
 
As about the programming question: once you know the format of the image file, it shouldn't be a daunting task writing a function to extract the required info.
Smile | :)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

On Windows NT v4.0 I have a text-files.
If I try to use in a batch the next code:
 
set zname=Tb.txt
FOR /F "delims=" %%i in (%zname%) do (
echo %%i
)
 
Then I can see on the screen the content of the file.
But if the name of the file has spaces, like :
 
set zname=T b.txt
FOR /F "delims=" %%i in ("%zname%") do (
echo %%i
)
 
then the echo will print on the screen only the name of the file, like:
 
T b.txt
 
instead of the content of the file. By taking away the ""
example: FOR /F "delims=" %%i in (%zname%) do (
I getting back the error:
Cannot find the file T.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 555
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 359
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,466
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,897


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 15 Jun 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