Click here to Skip to main content
11,412,159 members (64,696 online)
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 OriginalGriff 348
1 Sergey Alexandrovich Kryukov 225
2 Sascha Lefévre 175
3 ProgramFOX 130
4 Maciej Los 110
0 Sergey Alexandrovich Kryukov 8,980
1 OriginalGriff 7,263
2 Maciej Los 3,500
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 15 Jun 2011
Copyright © CodeProject, 1999-2015
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