ITeye博客

C语言中的graphics.h问题

易水侠客 · 2013-07-06 14:34 · C programming · 编程语言 · Markdown

如果头文件有这个,#include <graphics.h>,编译时会显示
 Cannot open include file: 'graphics.h': No such file or directory

VC 绘图库(下载graphics.h):可以在 VC 下像 Turbo C 的 BGI 一样简单的绘图

安装 
下载的压缩包里除了说明,只有两个主要文件,将 graphics.lib 拷贝到 VC6 文件夹下的 Lib 文件夹内,将 graphics.h 拷贝到 Include 文件夹内,仅此而已,所以我就偷懒没有做安装程序了。 
使用说明 
目前只模拟了极少数 Borland C++ 3.1 的绘图库,只是把我个人理解中的初学者常用的图形函数模拟了一下。 
使用上,基本和 TC 没什么区别。看一个画圆的例子吧: 

#include <graphics.h> // 就是需要引用这个图形库 
#include <conio.h> 
void main() 
{ 
initgraph(640, 480); // 这里和 TC 略有区别 
circle(200, 200, 100); // 画圆,圆心(200, 200),半径 100 
getch();              // 按任意键继续 
closegraph();    // 关闭图形界面 
} 

 呵呵,很简单吧。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。