📄 精细绘图及动画.htm
字号:
<P>key=getch();<BR>if(y0-height-3*width1-i==0)<BR>outtextxy(60,100,"Successfully!!!
Press ESC to
quit");<BR>if(key==ESC){<BR>if(y0-height-3*width1-i>0){<BR>cleardevice();<BR>outtextxy(100,100,"Failue.
What did you do?");<BR>outtextxy(130,300,"Press
any key to quit.");<BR>getch();<BR>}<BR>}</P>
<P>}while(key!=ESC);</P>
<P>free(buf);<BR>closegraph();<BR>return 0;</P>
<P>}<BR>/*****************Install the graphics
library***********************/</P>
<P>void InstallGraph(void)<BR>{<BR>int
grdriver=DETECT;<BR>int grmode;<BR>int
errorcode;<BR>char *errormsg;</P>
<P>registerbgidriver(EGAVGA_driver);<BR>registerbgifont(triplex_font);<BR>initgraph(&grdriver,&grmode,"");</P>
<P>errorcode=graphresult();<BR>errormsg=grapherrormsg(errorcode);<BR>if(errorcode!=grOk){<BR>printf("Graphics
error: %s\n",errormsg);<BR>printf("Press any key
to
exit.\n");<BR>getch();<BR>exit(1);<BR>}<BR>}</P>
<P>/************************Draw the star
********************************/</P>
<P>void DrawStar(void)<BR>{<BR>int
seed=2000;<BR>int
i,dotx,doty,height,width,color,maxcolor;</P>
<P>maxcolor=getmaxcolor();<BR>width=getmaxx();<BR>height=getmaxy();</P>
<P>srand(seed);<BR>for(i=0;i<250;i++){<BR>dotx=i+random(width-1);<BR>doty=i+random(height-1);<BR>color=random(maxcolor);</P>
<P>setcolor(color);<BR>putpixel(dotx,doty,color);<BR>circle(dotx+1,doty+1,1);</P>
<P>}<BR>srand(seed);<BR>}<BR>/****************Draw
the bottom gun********************/<BR>void
DrawGun(void)<BR>{<BR>int x0=300;<BR>int
y0=430;<BR>int height=45;<BR>int rx=20;<BR>int
ry=5;<BR>int rightx,righty,leftx,lefty;<BR>int
centery1=30;<BR>rightx=righty=leftx=lefty=12;</P>
<P><BR>setcolor(LIGHTGREEN);<BR>ellipse(x0,y0,180,360,rx,ry);<BR>ellipse(x0,y0-height,0,360,rx,ry);<BR>line(x0+rx,y0,x0+rx,y0-height);<BR>line(x0-rx,y0,x0-rx,y0-height);</P>
<P>moveto(x0+rx,y0);<BR>lineto(x0+rx+rightx,y0+righty);<BR>moveto(x0+rx+rightx,y0+righty);<BR>lineto(x0+rx+rightx+10,y0+righty+10);<BR>circle(x0+rx+rightx+10,y0+righty+10,4);</P>
<P><BR>moveto(x0,y0+ry);<BR>lineto(x0,y0+centery1);<BR>moveto(x0,y0+centery1);<BR>lineto(x0,y0+centery1+10);<BR>circle(x0,y0+centery1+10,4);</P>
<P><BR>moveto(x0-rx,y0);<BR>lineto(x0-rx-leftx,y0+lefty);<BR>moveto(x0-rx-leftx,y0+lefty);<BR>lineto(x0-rx-leftx-10,y0+lefty+10);<BR>circle(x0-rx-leftx-10,y0+lefty+10,4);</P>
<P>line(x0-rx-leftx,y0+lefty,x0,y0+centery1);<BR>line(x0,y0+centery1,x0+rx+rightx,y0+righty);<BR>}<BR>/*****************Draw
the plan fly to the
sky***********************/<BR>void
DrawPlan(void)<BR>{</P>
<P><BR>int size;</P>
<P>setcolor(LIGHTRED);<BR>setfillstyle(1,BLUE);<BR>ellipse(x0,y0-height,0,180,width1,3*width1);</P>
<P>moveto(x0+width1,y0); /*moveto center right
side*/<BR>lineto(x0+width1,y0-height);<BR>moveto(x0+width1,y0);<BR>lineto(x0+width2,y0+y2);</P>
<P>moveto(x0-width1,y0); /*moveto center left
side*/<BR>lineto(x0-width1,y0-height);<BR>moveto(x0-width1,y0);<BR>lineto(x0-width2,y0+y2);</P>
<P>moveto(x0+width2,y0+y3);/*moveto right bottom
side*/<BR>lineto(x0+width2,y0+y1);<BR>moveto(x0+width2,y0+y3);<BR>lineto(x0+width1,y0+y2);</P>
<P>moveto(x0-width2,y0+y3);/*moveto left bottom
side*/<BR>lineto(x0-width2,y0+y1);<BR>moveto(x0-width2,y0+y3);<BR>lineto(x0-width1,y0+y2);</P>
<P>moveto(x0,y0+y4); /*moveto the
bottomest*/<BR>lineto(x0+width1,y0+y2);<BR>moveto(x0,y0+y4);<BR>lineto(x0-width1,y0+y2);</P>
<P>setfillstyle(2,LIGHTRED); /*fill the plan with
a style */<BR>floodfill(x0,y0,LIGHTRED);</P>
<P>size=imagesize(x0-width2-1,y0-height-3*width1,<BR>x0+width2+1,y0+y4);<BR>buf=malloc(size);<BR>if(!buf){<BR>printf("No
enough
memory!");<BR>exit(0);<BR>}<BR>getimage(x0-width2,y0-height-3*width1,x0+width2,y0+y4,buf);</P>
<P>}</P>
<P></P>
<P align=center><FONT color=#3300cc>资料收集:beck
Copyright 2002 www.vcok.com, All Rights Reserved
</FONT></P>
<P></P></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE align=center bgColor=#d7ebff border=0
borderColorDark=#ffffff cellPadding=0 cellSpacing=0
width=650><TBODY>
<TR align=middle bgColor=#3986ef vAlign=center>
<TD align=left colSpan=2 height=25 id=notice
vAlign=center> <FONT
color=#ffffff><B>[</B>来源<B>]</B>: 不详
<B>[</B>编辑<B>]</B>: <FONT color=#ffffff>beck
</FONT> <B>[</B>加入时间<B>]</B>:2002-8-11
</FONT></TD></TR></TBODY></TABLE><BR><BR>
<TABLE border=0 width="100%">
<TBODY>
<TR>
<TD>
<LI><FONT color=#0772b1>上篇文章</FONT>:<A
href="http://www.vcok.com/class/list.asp?id=219">图形旋转的C语言源程序</A>
<LI><FONT color=#0772b1>下篇文章</FONT>:<A
href="http://www.vcok.com/class/list.asp?id=221">两个矩阵相乘的源程序</A>
</LI></TD>
<TD align=right>
<SCRIPT language=JavaScript>
var onecount;
onecount=0;
subcat = new Array();
subcat[0] = new Array("C语言教程","8","35");
subcat[1] = new Array("C技术文章","8","36");
subcat[2] = new Array("C试题库","8","37");
subcat[3] = new Array("C程序百例","8","38");
subcat[4] = new Array("C函数库","8","39");
subcat[5] = new Array("数据结构教程","9","40");
subcat[6] = new Array("常用算法","9","41");
subcat[7] = new Array("在线测试","8","42");
subcat[8] = new Array("linux入门级","10","43");
onecount=9;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</SCRIPT>
<FORM action=ru_query.asp method=post name=myform>文章搜索:
<SELECT name=action size=1> <OPTION selected
value=title>按文章标题搜索</OPTION> <OPTION
value=writer>按文章来源搜索</OPTION> <OPTION
value=content>按文章内容搜索</OPTION> <OPTION
value=Nkey>按照关键词搜索</OPTION></SELECT> <SELECT
name=classid
onchange=changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)
size=1> <OPTION selected value="">请指定范围</OPTION>
<OPTION value=8>C语言教室</OPTION> <OPTION
value=9>数据结构</OPTION> <OPTION
value=10>Linux初探</OPTION></SELECT> <SELECT
name=Nclassid> <OPTION selected
value="">请指定范围</OPTION> <OPTION value=8>C语言教程</OPTION>
<OPTION value=8>C技术文章</OPTION> <OPTION
value=8>C试题库</OPTION> <OPTION value=8>C程序百例</OPTION>
<OPTION value=8>C函数库</OPTION> <OPTION
value=9>数据结构教程</OPTION> <OPTION value=9>常用算法</OPTION>
<OPTION value=8>在线测试</OPTION> <OPTION
value=10>linux入门级</OPTION></SELECT> <INPUT maxLength=50
name=keyword size=10 value=输入关键字> <INPUT name=Submit type=submit value=搜索>
</FORM></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD bgColor=#e6e6e6 width="50%">□- C技术文章热点文章</TD>
<TD bgColor=#e6e6e6 width="50%">□- 相关文章</TD></TR>
<TR>
<TD bgColor=#ffffff vAlign=top width="50%">1.<A
href="http://www.vcok.com/class/list.asp?id=213" target=_top
title=Tc2.0编写俄罗斯方块游戏> Tc2.0编写俄罗斯方块游戏 </A>[阅读:<FONT
color=red>10938</FONT>]<BR>2.<A
href="http://www.vcok.com/class/list.asp?id=331" target=_top
title=查找算法演示:二分法> 查找算法演示:二分法 </A>[阅读:<FONT
color=red>10255</FONT>]<BR>3.<A
href="http://www.vcok.com/class/list.asp?id=326" target=_top
title=以前常用的攻击软件源代码> 以前常用的攻击软件源代码 </A>[阅读:<FONT
color=red>10045</FONT>]<BR>4.<A
href="http://www.vcok.com/class/list.asp?id=327" target=_top
title=设计彩色框的C源程序> 设计彩色框的C源程序 </A>[阅读:<FONT
color=red>9488</FONT>]<BR>5.<A
href="http://www.vcok.com/class/list.asp?id=330" target=_top
title=排序算法演示:冒泡法> 排序算法演示:冒泡法 </A>[阅读:<FONT
color=red>8143</FONT>]<BR></TD>
<TD bgColor=#ffffff vAlign=top width="50%"><A
href="http://www.vcok.com/class/list.asp?id=223">用c语言实现艺术清屏</A><BR><A
href="http://www.vcok.com/class/list.asp?id=221">两个矩阵相乘的源程序</A><BR><A
href="http://www.vcok.com/class/list.asp?id=220">精细绘图及动画</A><BR><A
href="http://www.vcok.com/class/list.asp?id=214">全屏幕模拟时钟的C源程序</A><BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<DIV></DIV>
<TABLE bgColor=#ffffff border=0 width=778>
<TBODY>
<TR bgColor=#ffffff>
<TD colSpan=3></TD></TR>
<TR vAlign=baseline>
<TD colSpan=3>
<HR noShade SIZE=1>
</TD></TR>
<TR>
<TD width="7%"> </TD>
<TD width="87%">
<DIV align=center>唯C世界|<FONT
face="Arial, Helvetica, sans-serif">http://wWw.VcOk.Com</FONT> <FONT
face="Arial, Helvetica, sans-serif">Ver 1.00 Design By <FONT
face="Verdana, Arial, Helvetica, sans-serif"><B><FONT
color=#ff0000><A href="http://www.vcok.com/"><FONT
color=#ff0009>VcOk.com</FONT></A></FONT></B></FONT></FONT></FONT></DIV></TD>
<TD width="6%"> </TD></TR>
<TR>
<TD width="7%"> </TD>
<TD width="87%">
<DIV align=center><FONT
face="Arial, Helvetica, sans-serif">CopyRight <FONT
color=#ff0000>©</FONT> .:.:.:2002-2008 AT Tie Ling Liaoning
China:.:.:.</FONT></DIV></TD>
<TD width="6%"> </TD></TR>
<TR>
<TD width="7%"> </TD>
<TD align=middle
width="87%"> 辽宁省铁岭师范高等专科学校计算机中心
</TD></TR></TBODY></TABLE>
<TABLE bgColor=#b5b6b5 cellSpacing=1 height=30 width=778>
<TBODY>
<TR>
<TD align=middle bgColor=#ffffff>在此感谢 <A
href="http://www.kingxp.com/">广东省中联科技网络有限公司</A> 为我公司提供空间。/ 合作伙伴:<A
href="http://www.11k.net/">中国站长资讯网</A></TD></TR></TBODY></TABLE></TR></TBODY></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -