本文目录一览:
用c语言编写一个欢迎界面动画,求教。
这是一个界面动画的主题部分,头文件还有一些pi的预处理命令我都省了
希望给你参考一下,C语言的图形动画只能在TC下编写,运行
int a=DETECT,b; /*切换到图形模式*/
initgraph(a,b,"d:\\tc");
while(!kbhit())
{j+=10;
for(i=0;i=2000;i++)
{
x=300+100*cos(2*i*pi/1000)*sin(i*pi/1000+j*pi/1000);
y=240+100*cos(2*i*pi/1000)*cos(i*pi/1000+j*pi/1000);
if(j%500==0) k++;
putpixel(x,y,k); /*在指定位置画一像素*/
}
delay(5000); /*延时函数[毫秒数]*/
cleardevice(); /* 清除图形屏幕*/
}
getch();
closegraph(); /*切换到字符模式*/
急求C语言编写欢迎界面几秒后跳入菜单界面的程序代码,哪位大神会呀
#include
#include
#include
"stdio.h"
void
main()
{
int
n;
printf("欢迎界面");//欢迎界面
Sleep(1000);//延时
system("cls");//清屏
//菜单界面
printf("***********************************************\n");
printf("*************1、
***********************\n");
printf("*************2、
***********************\n");
printf("*************3、
***********************\n");
printf("***********************************************\n");
//菜单选择
scanf("%d",n);
if(n==1){}
else
if(n==2){}
else
if(n==3){}
else
{printf("错误!");}
}
希望能帮助你,喜欢请采纳,有问题欢迎追问!
用C语言编一个欢迎画面
#include graphics.h
#include stdio.h
char huan[]={
/* 12*12 '欢'字宋体 汉字字模 */
0x02,0x00,0xfa,0x00,0x13,0xe0,0x94,0x20,
0x55,0x40,0x21,0x00,0x21,0x00,0x52,0x80,
0x4a,0x80,0x84,0x40,0x18,0x20,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
char ying[]={
/* 12*12 '迎'字宋体 汉字字模 */
0x42,0x00,0x2d,0xe0,0x09,0x20,0xc9,0x20,
0x49,0x20,0x49,0x20,0x4f,0x20,0x49,0x60,
0x41,0x00,0xb0,0x00,0x8f,0xe0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
char guang[]={
/* 12*12 '光'字宋体 汉字字模 */
0x04,0x00,0x44,0x40,0x24,0x80,0x15,0x00,
0xff,0xe0,0x12,0x00,0x12,0x00,0x12,0x00,
0x12,0x20,0x22,0x20,0xc1,0xe0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
char lin[]={
/* 12*12 '临'字宋体 汉字字模 */
0x22,0x00,0x22,0x00,0xa7,0xe0,0xa5,0x00,
0xa8,0x80,0xa0,0x00,0xa7,0xe0,0xa5,0x20,
0xa5,0x20,0x27,0xe0,0x24,0x20,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
void writehz(char *mat,int matsize,int x,int y,int fd,int color)
/*依次:字模指针、点阵大小、起始坐标(x,y)、颜色*/
{int i,j,k,n;
n=matsize/8+1;
if(matsize%8==0)
n=n-1;
setfillstyle(1,2);
for(j=0;jmatsize;j++)
for(i=0;in;i++)
for(k=0;k8;k++)
if(mat[j*n+i](0x80k))/*测试为1的位则显示*/
if(fd)
bar(x+i*8*fd+k*fd,y+j*fd,x+i*8*fd+k*fd+fd,y+j*fd+fd);
else
putpixel(x+i*8+k,y+j,color);
}
void huanying()
{
writehz(huan,16,100,180,8,4);
writehz(ying,16,230,180,8,4);
writehz(guang,16,360,180,8,4);
writehz(lin,16,490,180,8,4);
}
void main()
{
int gd=VGA,gm=VGAHI,i;
initgraph(gd,gm,"");
huanying();
getch();
closegraph();
}