UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » How to read image file using c in Unix

#1 2009-12-01 08:07 PM

rishisoft1
Member
Registered: 2009-10-30
Posts: 5

Re: How to read image file using c in Unix

Hi,
  How can I read the image file(like bmp  or jpeg) using c in unix.


thanks
12345678

Offline

#2 2009-12-01 08:18 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: How to read image file using c in Unix

Well, you can READ it easily enough just using read() or fread() or whatever you
like...  But, I assume your real question is how do you DISPLAY it, or manipulate it
in some way?  For that, you'll probably want to use some graphics library...  Which
one is appropriate depends on your system, and what other libs you're using, etc...
Eg: if writing a GTK+ GUI app, you'd just use the gtk_image_*() stuff...  If you want
to just load and manipulate in some way, you may want to use a lower-level lib like
libjpeg or libpng or whatever...

Offline

#3 2009-12-01 08:46 PM

rishisoft1
Member
Registered: 2009-10-30
Posts: 5

Re: How to read image file using c in Unix

I am using IBM Unix.
can I copy the data  after reading  using fread into another buffer and  write that buffer to different file?
Please  tell me how I can display it after reading it.


12345678

Offline

#4 2009-12-01 09:44 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: How to read image file using c in Unix

IBM Unix, as in AIX?  I'm not familiar with what libraries and such it installs by default,
but if they're not already there, you can surely install some that'd work...  But, like I
said, you're likely going to want to use some image library that handles most of the
hard work for you...  How are you planning to display it?  In an X11 GUI, I assume?
Using what X toolkit library?  GTK+ or something else?  It's easy enough to do in
GTK, as I already mentioned before...

Offline

#5 2009-12-22 04:49 PM

ocean_sky
Member
Registered: 2009-10-17
Posts: 5

Re: How to read image file using c in Unix

Offline

  • Index
  • » C
  • » How to read image file using c in Unix

Board footer

Powered by FluxBB