Click here to Skip to main content
11,790,385 members (54,013 online)
Rate this: bad
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 4-May-10 23:00pm
Edited 13-May-10 0: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
0 OriginalGriff 1,114
1 Maciej Los 825
2 KrunalRohit 686
3 CPallini 611
4 ppolymorphe 610

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.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