- 论坛徽章:
- 95
|
原帖由 greentime 于 2007-5-18 22:44 发表
我刚开始看linux下C语言编程,请问如何作图,与TC的#include<graphics.h>有什么区别呢,希望路过的达人赐教,有示例代码贴出来更好,谢了先!
comp.lang.c FAQ 的 Question 19.10
Q: How can I do graphics?
A: Once upon a time, Unix had a fairly nice little set of device-independent plot functions described in plot(3) and plot(5). The GNU libplot library, written by Robert Maier, maintains the same spirit and supports many modern plot devices; see http://www.gnu.org/software/plotutils/plotutils.html.
A modern, platform-independent graphics library (which also supports 3D graphics and animation) is OpenGL. Other graphics standards which may be of interest are GKS and PHIGS.
If you're programming for MS-DOS, you'll probably want to use libraries conforming to the VESA or BGI standards.
If you're trying to talk to a particular plotter, making it draw is usually a matter of sending it the appropriate escape sequences; see also question 19.9. The vendor may supply a C-callable library, or you may be able to find one on the net.
If you're programming for a particular window system (Macintosh, X windows, Microsoft Windows), you will use its facilities; see the relevant documentation or newsgroup or FAQ list.
References: PCS Sec. 5.4 pp. 75-77 |
|