Click here to Skip to main content
11,926,961 members (49,890 online)
Rate this:
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
Rate this: bad
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 | :)
Rate this: bad
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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | 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