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.

11 Years
Discussion Span
Last Post by Ancient Dragon

This might help -- shows different file formats.

True , that site contains much more to know about file types.
and their healders. But I'm too lazy to write the helder parsing and
data extraction framework. Instead of writing it groud up what I doing
is just normally download a framework ( open source ) and use it.

Just google about C++ image libraries you will get what you need.


anyway sorry about giving you a lazy idea !
no if you doing this as a assignment then write it your own. if not
your in a somepart of a big project then go ahead and use it.

The circle is invented already , you gain nothing redesigning it but that's the only way to gain experience.


Welcome to the forum, Priva.t! ;)

A few very solid suggestions for you:

1) For your problems, unless it's EXACTLY the same, always start a new thread
2) You have to be VERY specific about what you are asking about. "Draw nonlinear objects", doesn't tell anyone what you are stumped on doing.

3) With your first post on a subject, post your efforts to solve the problem. This is a forum policy to reduce the "I need the codes for this!" kind of posts.


hw to draw nonlinear objects

There are algorithms to draw that kind of objects.
For cricles you can use midpoint cricle drawing algorithm.
a modified version of midpoint algorithm can be used to draw elipses.

for the B-spline curves there are little bit complex algorithms.
You better read a rasterization algorithm chapter in a computer graphics book
if you want to implement those by hand.
I recommand you to read books like Computer Graphics C Version 2Ed Donald Hearn,
Graphics GEMS I,II,II like books.

or else you a 3rd party library to draw those things.I suggest you to use the
OpenGL it's very nice for scientific computing (actually good for game developing too).
Or in a simple way you can use SDL like simple library.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.