Jump to content

Graphics in C language

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Guest_ravs2k6_*

Guest_ravs2k6_*
  • Guests
Hi all,
Could you tell me how to write simple graphics program in c, for example, how to take the format of bmp, pgm, csd file from image file?
how to convert from one format to other? If anybody knows a good book or web site, please tell me soon.

#2
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
you would have to read the binary picture file byte-for-byte and convert it into the image. Then you could rewrite it in other formats.

#3
moonrise

moonrise

    Learning Programmer

  • Members
  • PipPipPip
  • 40 posts
hi lop can you explain it in brief

#4
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
If you wanted to do it yourself, you'd have to get file format specs for each format you wanted to support. Yuck.

I'd suggest looking for a library you can use. Assuming you're targeting Win32, I don't think there's much in the realm of graphics manipulation in the API. But I did find a couple of promising candidates:
PixelToaster
FreeImage (C++)
There's bound to be others available as well.

#5
DevilsCharm

DevilsCharm

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 884 posts
I knew that other programs were used in conjuction with C/C++ to create images, nobody could create images freehand just by using text (unless it's like, turtle graphics).

#6
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,712 posts
If you want file specs, there's a great website for every file imaginable:

Wotsit.org

Just type in the file extension or the type of file, and you'll usually get results.