本文整理汇总了C++中setbkcolor函数的典型用法代码示例。如果您正苦于以下问题:C++ setbkcolor函数的具体用法?C++ setbkcolor怎么用?C++ setbkcolor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setbkcolor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: submenu
void submenu()
{ int i;
//////pintar menu
setbkcolor(WHITE);
settextstyle(2,0,0);
box(0,0,getmaxx(),getmaxy(),1,0);
//for (i=1;i<1000;i=i+1)putpixel(rand()%640,rand()%480,RED);
box(10,0,110,40,1,7);
outtextxy(20,10,"Batallas");
box(120,0,230,40,1,7);
outtextxy(130,10,"Trofeos");
box(240,0,350,40,1,7);
outtextxy(250,10,"Guardar");
box(530,0,600,40,1,7);
outtextxy(540,10,"Salir");
//////////////
box(10,40,110,60,1,7);
outtextxy(40,45,"Batalla 1");
box(10,60,110,80,1,7);
outtextxy(40,65,"Batalla 2");
box(10,80,110,100,1,7);
outtextxy(40,85,"Batalla 3");
box(10,100,110,120,1,7);
outtextxy(40,105,"Batalla 4");
box(10,120,110,140,1,7);
outtextxy(40,125,"Batalla 5");
}
示例2: intro
void intro()
{ int i,j;
clrscr();
cleardevice();
setbkcolor(BLACK);
gotoxy (25,12);
settextstyle(4,0,6);
for(i=0; i<=10; i++)
{
setcolor(i%16);
outtextxy(2,2,"SHUFFLE GAME");
settextstyle(1,0,7);
outtextxy(20,200,"");
delay(100);
outtextxy(180,200,"1");
delay(100);
outtextxy(220,200,"2");
delay(100);
outtextxy(260,200,"3");
delay(100);
outtextxy(180,300,"4");
delay(100);
outtextxy(220,300,"5");
delay(100);
outtextxy(260,300,"6");
delay(100);
outtextxy(180,400,"7");
delay(100);
outtextxy(220,400,"8");
settextstyle(4,0,8);
delay(100);
getch();
}
}
示例3: uno
void uno()
{
clearviewport();
setbkcolor(0);
fillellipse(320,240,100,50);
getch();
}
示例4: popup
void popup()
{
int x1,x2,y1,y2, i,
nRec = 13; // Numero de rectangulos
x1 = x2 = (WIDTH/2);
y1 = y2 = (HEIGHT/2);
setfillstyle(1,0x00CCFF);
for(i=0; i<nRec; x1-=15, y1-=10, x2+=15, y2+=10, i++)
{
bar(x1, y1, x2, y2);
delay(15);
}
// ¡PERDISTE!
setbkcolor(0x00CCFF);
setcolor(0x0054D3);
settextstyle(3, HORIZ_DIR, 6);
outtextxy(WIDTH/2-textwidth("¡PERDISTE!")/2, y1+textheight("P")/2, "¡PERDISTE!");
setcolor(0x4b78F2);
settextstyle(3, HORIZ_DIR, 3);
outtextxy(WIDTH/2-textwidth("Presiona cualquier tecla")/2, y1+textheight("P")*4, "Presiona cualquier tecla");
settextstyle(3, HORIZ_DIR, 3);
outtextxy(WIDTH/2-textwidth("para continuar")/2, y1+textheight("P")*5, "para continuar");
}
示例5: end
void end()
{
int i,j,k;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
setbkcolor(BROWN);
setcolor(RED);
settextstyle(1,0,8);
outtextxy(130,50,"_-~Search~-_");
setcolor(RED);
settextstyle(1,0,8);
outtextxy(10,190,"_-~For me~-_");
settextstyle(7,0,3);
setcolor(RED);
setcolor(10+BLINK);
outtextxy(300,300,"THANK YOU");
setcolor(10);
outtextxy(300,355,"Have a nice day.....");
setcolor(4);
for(k=0;k<640;k++)
{
if(k==635)
{
for(j=0;j<480;j++)
{
circle(635,j,4);
delay(1);
}
}
else
{
circle(k,5,5);
delay(1);
}
}
for(k=639;k>(-1);k--)
{
if(k==0)
{
for(j=475;j>0;j--)
{
circle(5,j,5);
delay(1);
}
}
else
{
circle(k,475,4);
delay(1);
}
}
restorecrtmode();
}
示例6: main
void main()
{
int ch;
clrscr();
while(1)
{
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("%d",errorcode);
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
cleardevice();
setbkcolor(6);
setcolor(15);
settextstyle(1,0,1);
sprintf(msg,"SRI JAYACHAMARAJENDRA COLLEGE OF ENGINEERING");
outtextxy(75,10,msg);
sprintf(msg,"MYSORE-570006");
outtextxy(230,40,msg);
sprintf(msg,"STUDENT DATABASE");
outtextxy(220,100,msg);
sprintf(msg,"1. INSERT A RECORD");
outtextxy(200,200,msg);
sprintf(msg,"2. ACCESS A RECORD");
outtextxy(200,240,msg);
sprintf(msg,"3. DELETE A RECORD");
outtextxy(200,280,msg);
sprintf(msg,"4. DISPLAY THE DATABASE");
outtextxy(200,320,msg);
sprintf(msg,"5. EXIT");
outtextxy(200,360,msg);
sprintf(msg," Please enter your choice:");
outtextxy(220,400,msg);
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("\n\t\t\t\t\t");
scanf("%d",&ch);
clrscr();
switch(ch)
{
case 1:write();
break;
case 2:read();
break;
case 3:del();
break;
case 4:display();
break;
case 5:exit(0);
default:printf("Wrong Choice:Please enter a valid choice");
}
getch();
closegraph();
}
}
示例7: guardar
void guardar()
{
inicializa();
setbkcolor(7);
settextstyle(3,0,4);
outtextxy(100,50,"Escriba nombre para la partida");
capturacadena(100,100);
}
示例8: resetWindow
void resetWindow()
{
//Sets background color to GREEN
setbkcolor (GREEN);
//Sets drawing color to WHITE
setcolor(WHITE);
clearviewport();
}
示例9: setbkcolor
void Ventana::Error(char *p) {
setbkcolor(YELLOW);
setcolor (BLACK);
outtextxy(0,0,p);
getch();
closegraph();
exit (1);
}
示例10: main
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"NULL");
setbkcolor(BLUE);
outtextxy(200,200,"COMPUTER GRAPHICS");
getch();
closegraph();
}
示例11: canvas_begin_draw
void canvas_begin_draw( void ) {
drawing = true;
setactivepage( canvas_inactive_page() );
cleardevice();
setbkcolor(WHITE);
return;
}
示例12: main
int main(){
initgraph(500,600);
setbkcolor(EGERGB(0x0, 0x40, 0x0));
setcolor(1);
rectangle(100,100,300,500);
getch();
closegraph();
return 0;
}
示例13: first
void first()
{
int i,j,k;
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
setbkcolor(BROWN);
setcolor(RED);
settextstyle(1,0,8);
outtextxy(130,50,"_-~Search~-_");
setcolor(RED);
settextstyle(1,0,8);
outtextxy(10,190,"_-~For Me~-_");
settextstyle(7,0,3);
setcolor(RED);
setcolor(10);
setcolor(4);
for(k=0;k<640;k++)
{
if(k==635)
{
for(j=0;j<480;j++)
{
circle(635,j,4);
delay(1);
}
}
else
{
circle(k,5,5);
delay(1);
}
}
for(k=639;k>(-1);k--)
{
if(k==0)
{
for(j=475;j>0;j--)
{
circle(5,j,5);
delay(1);
}
}
else
{
circle(k,475,4);
delay(1);
}
}
getch();
restorecrtmode();
}
示例14: tienda
void tienda()
{
int i, xi, pag = 1,
huesos,
pos = 0; // Posicion del indicador.
char tecla;
String aux;
obtenerDatos(&huesos, &i);
setvisualpage(pag);
while(tecla!=27)
{
setactivepage(pag=!pag);
setfillstyle(1, COLOR(79, 182, 225));
bar(0,0, WIDTH, HEIGHT);
dibujaHuesos(huesos);
setfillstyle(1, 0x00f);
for(i=0, xi=WIDTH/3; i<NSKINS; i++, xi+=PIXEL_TAM*25)
if(pos==i)
bar(xi, 450+PIXEL_TAM*25, xi+PIXEL_TAM*20, 460+PIXEL_TAM*25);
if(kbhit())
switch(tecla = getch())
{
case 13:
compra(pos+1);
obtenerDatos(&huesos, &i);
break;
case 77:
if(pos!=2)
pos++;
break;
case 75:
if(pos!=0)
pos--;
break;
}
setbkcolor(0x0066F4);
setfillstyle(1, 0x0066F4);
setcolor(0x003988);
settextstyle(2, HORIZ_DIR, 8);
for(i=0, xi=WIDTH/3; i<NSKINS; i++, xi+=PIXEL_TAM*25)
{
sprintf(aux, "dino%d.%d.txt", i+1,pag);
dibujaSprite(aux, xi, 450);
sprintf(aux, "$ %d", 300*i);
if(i)
outtextxy(xi, 460+PIXEL_TAM*25, aux);
}
setvisualpage(pag);
delay(80);
}
iniciaEntorno();
}
示例15: init
void init(int color)
{
int drive,mode;
drive=DETECT;
registerbgidriver(EGAVGA_driver);
initgraph(&drive,&mode,"");
setbkcolor(color);
}