当前位置: 首页>>代码示例>>C++>>正文


C++ closegraph函数代码示例

本文整理汇总了C++中closegraph函数的典型用法代码示例。如果您正苦于以下问题:C++ closegraph函数的具体用法?C++ closegraph怎么用?C++ closegraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了closegraph函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{

	int gdriver = DETECT,gmode,errorcode;
	initgraph(&gdriver,&gmode,"");

	polyfill p;
	p.getdata();
	p.fillpol();
	getch();
	closegraph();
	return 0;
}
开发者ID:sudeepb02,项目名称:pl,代码行数:13,代码来源:polyfill_scanline.cpp

示例2: main

int main(void) {
	setinitmode(INIT_DEFAULT|INIT_NOFORCEEXIT);
	
	initgraph(640, 480);
	
	randomize();
	
	setrendermode(RENDER_MANUAL);
	
	mainloop();
	closegraph();
	return 0;
}
开发者ID:cuidezhu,项目名称:Cpp_programming_introduction,代码行数:13,代码来源:TestAnimation1.cpp

示例3: main

int main(void)
{
	setinitmode(INIT_ANIMATION);
	// 图形初始化,窗口尺寸640x480
	initgraph(640, 480);
	// 随机数初始化,如果需要使用随机数的话
	randomize();
	// 程序主循环
	mainloop();
	// 关闭绘图设备
	closegraph();
	return 0;
}
开发者ID:AlexiaChen,项目名称:ConnectFive,代码行数:13,代码来源:t26.cpp

示例4: main

int main(){
	int gd = DETECT , gm ;
	int a,i, n,r=40;
	double rotate_angle = 0 , t = 0; 
	
	// inputs
	printf("Enter radius and spokes\n");
	scanf("%d %d",&r,&n);
	
	// initialization graphs
	initgraph(&gd,&gm,"");
	setcolor(3);

	a = xc + r;

	while(!kbhit()){



		while(a<=630){ // so as to ensure that the wheel doesnt run out of the page
			t = pi*rotate_angle / 180;
			cleardevice();
			circle(xc,yc,r);

			// use polar coordinates to rotate.. !! 
			for(i=0;i<n;i++,rotate_angle+=360/n){
				// now moving of wheel takes place in two steps;;;
				// rotation and translation
				// note: only the center of mass of any circular body will undergo translation motion
				// whereas the boundary of the body will undergo rotation motion.
				// we are first finding the angle by which each spoke rotaotes and the we rotate the spoke
				t = pi*rotate_angle/180; 
				x[i] = xc+ r*cos(t);
				y[i] = yc + r*sin(t);
				line(xc,yc,x[i],y[i]);
			}
			rotate_angle+=2; // for next frame ,, ... 
			xc+=2; // translating the center of circle
			a=xc+r; 
			delay(20);	
		}	
		// xc = 100 ; a = xc+r; // uncomment this line if u wanna continous rotation
	}
	getchar();
	closegraph();





}
开发者ID:kushalvyas,项目名称:Computer_Graphics,代码行数:51,代码来源:movingwheel.c

示例5: main

int main() {
	{

		TEXTO a(GOTHIC_FONT,VERT_DIR,10,"Turbo");
		textoColor b(TRIPLEX_FONT,HORIZ_DIR,10,"Pascal",LIGHTBLUE);
		textoAmpliar c(SANS_SERIF_FONT,HORIZ_DIR,10,"Lenguaje",
								LIGHTRED,5,1,10,1);
		int i=23;
		TEXTO *p;
		textoColor *q;
		textoAmpliar *r;
		int *s;
		char s1[10];

		int unidad=DETECT,modo;

		initgraph (&unidad,&modo,"c:\\bc\\bgi");
		if (graphresult() != 0) {
			cout << "Error al tratar de pasar al modo grafico\n";
			getch();
			return 1;
		}
		p = &a;
		q = &b;
		r = &c;
		s = &i;

		p->escribir();
		getch();

		q->escribir();
		getch();

		r->escribir();
		getch();
		clearviewport();

		settextstyle (DEFAULT_FONT,HORIZ_DIR,0);
      itoa (*s,s1,10);
		outtext(s1);
		getch();
		clearviewport();
	}
	// Aqui se destruyen los objetos en el siguiente orden:
	// 1) El destructor de la clase derivada
	// 2) El destructor de la clase base
	// Favor estudiar numeral 12.2
	getch();
	closegraph();
	return 0;
}
开发者ID:agudeloandres,项目名称:C_Struct_Files,代码行数:51,代码来源:P493.CPP

示例6: main

void main()
{
	int gd=DETECT,gm;
	initgraph(&gd,&gm,"C:\\tc\\bgi");
	char ch='a';
	int length=5; // Set initial length of snake as 3
	//int lmax=10; //max length
	int radius=10;
	int xPosition[lmax],yPosition[lmax];
	for(int i=0;i<length;i++)
	{
		xPosition[i]=100+i*2*radius;
		yPosition[i]=100;
	}
	draw(xPosition,yPosition,length,radius);
	char temp=ch,temp2;
	while(ch!='p')
	{
		temp2=getch();
		if(temp=='a' && temp2=='d')
		{
			ch=temp;
		}
		else if(temp=='d' && temp2=='a')
		{
			ch=temp;
		}
		else if(temp=='w' && temp2=='x')
		{
			ch=temp;
		}
		else if(temp=='x' && temp2=='w')
		{
			ch=temp;
		}
		else
		{
			ch=temp2;
		}
		temp=ch;
		cleardevice();
		assignPosition(xPosition,yPosition,length,ch,radius);
		draw(xPosition,yPosition,length,radius);
		/*for(i=0;i<length;i++)
		{
			printf("%d %d for %d \n ",xPosition[i],yPosition[i],i+1);
		}*/
	}
	getch();
	closegraph();
}
开发者ID:sjs7007,项目名称:Snake,代码行数:51,代码来源:newSnake.cpp

示例7: main

main()
{
	int driver=DETECT,mode,i;
	static double x1[]={0.0,10.0,80.0,100.0,0.0};
	static double y1[]={0.0,50.0,50.0,0.0,0.0};
	static double x2[5],y2[5],x3[5],y3[5],x4[5],y4[5];
	double x,xx,yy,r;
	initgraph(&driver,&mode,"");
	axis();

	for(i=0;i<=3;i++){
		line(scx(x1[i]),scy(y1[i]),scx(x1[i+1]),scy(y1[i+1]));
	}
	scale(2.0);
	
	for(i=0;i<=4;i++){
		x2[i]=affinex(x1[i],y1[i],1.0);
		y2[i]=affiney(x1[i],y1[i],1.0);
		delay(30000);
	}

	for(i=0;i<=3;i++){
		line(scx(x2[i]),scy(y2[i]),scx(x2[i+1]),scy(y2[i+1]));
	}

	r=60;
	rotate(r);
	for(i=0;i<=4;i++){
		x3[i]=affinex(x2[i],y2[i],1.0);
		y3[i]=affiney(x2[i],y2[i],1.0);
		delay(30000);
	}

	for(i=0;i<=3;i++){
		line(scx(x3[i]),scy(y3[i]),scx(x3[i+1]),scy(y3[i+1]));
	}

	palert::el(50.0,-150.0);
	for(i=0;i<=4;i++){
		x4[i]=affinex(x3[i],y3[i],1.0);
		y4[i]=affiney(x3[i],y3[i],1.0);
		delay(30000);
	}

	for(i=0;i<=3;i++){
		line(scx(x4[i]),scy(y4[i]),scx(x4[i+1]),scy(y4[i+1]));
	}

	getch();
	closegraph();
}
开发者ID:MForever78,项目名称:ADS,代码行数:51,代码来源:transformation.c

示例8: main

int main()
{
    int gd=DETECT,gm,min=0,maximum=0,c, location,loc, pp,  o,m,counter=0,ix,iy,BC,IC,FC;
    int p[100];
	int color=2;
    double t,m1;
    DWORD dwWidth = GetSystemMetrics(SM_CXSCREEN);
    DWORD dwHeight = GetSystemMetrics(SM_CYSCREEN);
    initwindow(dwWidth,dwHeight);
    int x0=dwWidth/2;
    int y0=dwHeight/2;
    int i,j,x[50],y[50];
    double xc[50],yc[50];

    for(i=0; i<dwHeight; i++)
        putpixel(x0,i,RED);

    for(j=0; j<dwWidth; j++)
        putpixel(j,y0,RED);

    int n;
    printf("Enter the number of coordinates or vertices \n");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        printf("Enter the %dth coordinate\n",i+1);
        scanf("%d",&x[i]);
        scanf("%d",&y[i]);
    }
    for(i=0;i<n;i++)
        printf("%d\t%d\n",x[i],y[i]);
    while(z!=(n-1))
    {
        line_draw(x[z],y[z],x[z+1],y[z+1],x0,y0,color);
        z++;
    }



    //Here
    printf("Enter interior cordinates ix and iy and fill colour \n");
    scanf("%d%d%d",&ix,&iy,&IC);
    boundaryfill4(x0+ix,y0-iy,IC);

    delay(40000);


    cleardevice();
    closegraph();

}
开发者ID:moon2222,项目名称:my_programs,代码行数:51,代码来源:BoundaryFill4.c

示例9: main

int main()
{
	int t,i,j,k,gd=DETECT,gm;
	initgraph(&gd,&gm,NULL);
	int flag=0;
	for(i=0;i<400;i++)
	{
		cleardevice();
		t=15;
		
		line(0,450,600,450);
		line(50+i,400,0+i,450);
		line(100+i,450,50+i,400);
		line(50+i,400,50+i,300);
		line(100+i,350,100+i,200);
		circle(50+i,280,20);
		line(50+i,300,100+i,350);
		line(0+i,350,50+i,300);
		arc(100+i,200,180,360,100);
		line(i,200,200+i,200);
		delay(10);
		for(j=0;j<450;j+=15)
		{
			for(k=0;k<=600;k+=t)
			{
				if(k<i||k>(200+i))
				{
				 	arc(k,j,0,360,1);
				}
				if(j<100)
				{
					arc(k,j,0,360,1);
				}
			}	
			if(flag==0)
				{
					delay(10);
				}
		}
		flag = 1;
		t+=10;
		if(t==35)
		{
			t=15;
		}
	}

	delay(5000);
	closegraph();
	return 0;
}
开发者ID:mukeshkharita,项目名称:graphicslab1,代码行数:51,代码来源:umbrella.c

示例10: main

main()      //draws some circles with text
{
   int graphdriver = DETECT, graphmode;
   initgraph(&graphdriver, &graphmode, "..\\bgi");
   MCircle Small(250, 100, 25, SANS_SERIF_FONT, "You");
   Small.Show();
   MCircle Medium(250, 150, 100, TRIPLEX_FONT, "World");
   Medium.Show();
   MCircle Large(250, 250, 225, GOTHIC_FONT, "Universe");
   Large.Show();
   getch();
   closegraph();
   return 0;
}
开发者ID:VNSecurityResearch,项目名称:SFT-Project,代码行数:14,代码来源:MCIRCLE.CPP

示例11: Pause

//**********************
void Pause(void)
{
  int c;
  c = getch();
  if( ESC == c ){
    closegraph();
    exit( 1 );
  }

  if( 0 == c ){
    c = getch();
  }
  cleardevice();
}
开发者ID:agudeloandres,项目名称:C_Struct_Files,代码行数:15,代码来源:INPUTBOX.CPP

示例12: main

int main()
{
	int gdrive, gmode;
	char *drvpath = "c:\\bc\\bgi";
	detectgraph(&gdrive, &gmode);
	initgraph(&gdrive, &gmode, drvpath);
	setbkcolor(0);
	setcolor(2);
	cleardevice();
	MyOwnFan(320, 230, 0);
	getch();
	closegraph();
	return 0;
}
开发者ID:CharellKing,项目名称:CollegeProgram,代码行数:14,代码来源:FAN.cpp

示例13: thank

void thank()
{
    closegraph();
    initwindow(1275,700);
    setfillstyle(1,1);
    floodfill(1,1,1);
    settextstyle(1,0,7);
    setcolor(10);
    setbkcolor(1);
    outtextxy(70,250,"Thankyou for the Purchase");
    delay(3000);
    home();
    recommend(10,11);
}
开发者ID:Saurabha94,项目名称:The-V-Play-Store,代码行数:14,代码来源:ty.cpp

示例14: main

int main()
{
	int gdriver = DETECT, gmode, x0, y0, x, xn, yn, i;
	float m, y;
	initgraph(&gdriver, &gmode, "C:\\TURBOC3\\BGI");
	rectangle(0, 0, MAXX, MAXY);

	l(20, 20, 300, 300, 10);


	getch();
	closegraph();
	return 0;
}
开发者ID:amir35,项目名称:ComputerGraphicsLab,代码行数:14,代码来源:5DDA.c

示例15: main

main()
{
   int gd = DETECT, gm;
   int x = 320, y = 240, radius;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   for ( radius = 25; radius <= 125 ; radius = radius + 20)
      circle(x, y, radius);

   getch();
   closegraph();
   return 0;
}
开发者ID:satish2,项目名称:Learn,代码行数:14,代码来源:delete.c


注:本文中的closegraph函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。