| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1083 人关注过本帖
标题:有关 画图的 问题
只看楼主 加入收藏
realll
Rank: 1
等 级:新手上路
帖 子:55
专家分:4
注 册:2009-7-23
结帖率:88.89%
收藏
已结贴  问题点数:0 回复次数:2 
有关 画图的 问题
1学用circle画圆形       2学用line画直线        3学用rectangle画方形

想请教 各位大虾 怎么用C语言做 画图的程序呢?
                   思路是怎样的?
                   一般会用到什么函数
谢谢各位




1
/*circle*/
#include "graphics.h"
main()
{int driver,mode,i;
float j=1,k=1;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(YELLOW);
for(i=0;i<=25;i++)
{
setcolor(8);
circle(310,250,k);
k=k+j;
j=j+0.3;
}
}  

2

#include "graphics.h"
main()
{int driver,mode,i;
float x0,y0,y1,x1;
float j=12,k;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(GREEN);
x0=263;y0=263;y1=275;x1=275;
for(i=0;i<=18;i++)
{
setcolor(5);
line(x0,y0,x0,y1);
x0=x0-5;
y0=y0-5;
x1=x1+5;
y1=y1+5;
j=j+10;
}
x0=263;y1=275;y0=263;
for(i=0;i<=20;i++)
{
setcolor(5);
line(x0,y0,x0,y1);
x0=x0+5;
y0=y0+5;
y1=y1-5;
}
}



3
#include "graphics.h"
main()
{int x0,y0,y1,x1,driver,mode,i;
driver=VGA;mode=VGAHI;
initgraph(&driver,&mode,"");
setbkcolor(YELLOW);
x0=263;y0=263;y1=275;x1=275;
for(i=0;i<=18;i++)
{
setcolor(1);
rectangle(x0,y0,x1,y1);
x0=x0-5;
y0=y0-5;
x1=x1+5;
y1=y1+5;
}
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);

 outtextxy(150,40,"How beautiful it is!");
line(130,60,480,60);
setcolor(2);
circle(269,269,137);
}




这是有关代码    我只看的懵懵懂懂    希望大家说点思路

[ 本帖最后由 realll 于 2010-2-13 16:40 编辑 ]
搜索更多相关主题的帖子: 画图 
2010-02-13 14:45
稀饭小超人
Rank: 2
等 级:论坛游民
帖 子:16
专家分:24
注 册:2009-11-5
收藏
得分:14 
- -还不会哦~帮楼主顶了

[url]http://image2./qianming/dnf3/201002/1265961796_211136697.jpg[/url]
2010-02-13 16:07
sainimu78
Rank: 2
等 级:论坛游民
帖 子:57
专家分:26
注 册:2010-1-27
收藏
得分:14 
关于函数怎么用的问题 与其发贴等人回不如自己百度 函数的用法问题不是技术性问题呢  建议楼主百度 "C语言 库函数大全"  或者就在 本论坛下一个 库函数查询程序 传送门->https://bbs.bccn.net/thread-82391-1-1.html
2010-02-15 16:26
快速回复:有关 画图的 问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011826 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved