Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

load JPG files

0 views
Skip to first unread message

Kenneth Wang

unread,
Dec 29, 1998, 3:00:00 AM12/29/98
to
how can I learn to load JPG files in ANSI C?


Parker Shaw

unread,
Dec 29, 1998, 3:00:00 AM12/29/98
to
Kenneth Wang wrote:

> how can I learn to load JPG files in ANSI C?

ANSI C has functions to open, read ... files.
JPG files are also files.

--
________________________________________________
Parker Shaw | Make it correct
psh...@cs.auckland.ac.nz | Make it elegant
________________________________________________

Jack Klein

unread,
Dec 29, 1998, 3:00:00 AM12/29/98
to
On Tue, 29 Dec 1998 12:50:26 +0800, "Kenneth Wang"
<ken...@pacific.net.sg> wrote:

> how can I learn to load JPG files in ANSI C?
>
>

<Jack>

You can open JPEG files for reading by using the "rb" mode string in a
call to fopen(). You can use functions like fgetc() and fread() to
read the contents into properly allocated memory. If you want to
manipulate the image data, you can find the format of JPEG files on
the Wotsit file format page at either of the links below:

http://www.wotsit.org
http://wotsit.simsware.com

If you want to display the image on a screen, you can't do this in
standard C at all because it does not define or provide any support
for graphics, video displays, or hardware of any kind.

You will have to resort to compiler or operating system specific
extensions, which you will need to ask about in a group which
discusses programming for your operating system or a support group for
your particular compiler.

</Jack>
--
Do not email me with questions about programming.
Post them to the appropriate newsgroup.


Jens Schweikhardt

unread,
Dec 29, 1998, 3:00:00 AM12/29/98
to
Parker Shaw <parke...@usa.net> wrote:
# Kenneth Wang wrote:

#> how can I learn to load JPG files in ANSI C?

# ANSI C has functions to open, read ... files.

Namely fopen() and fread(). Or for reading a character at a time, fgetc().

# JPG files are also files.

Reading Kenneth's question, I'm sure he knew this. However, if Kenneth
was interested in how to *display* them on a bit mapped output device,
the answer is system specific and should be asked in a platform
specific newsgroup.

Regards,

Jens
--
Jens Schweikhardt http://www.shuttle.de/schweikh/
SIGSIG -- signature too long (core dumped)

0 new messages