You are on page 1of 2

Graphics 2

============================================
#include <conio.h>
#include <iostream.h>
#include <dos.h>
#include <graphics.h>
void main()
{
clrscr();
int gdriver = DETECT, gmode;
initgraph(&gdriver,&gmode,"E:\\turbo\\tc\\bgi");
rectangle (130,50,480,400);
rectangle (130,50,480,90);
rectangle (450,90,480,110);
rectangle (370,350,400,370);
setcolor(RED);
int x,y,xmax,ymax;
xmax=getmaxx();
ymax=getmaxy();
outtextxy(458,97,"ON");
outtextxy(382,357,"1");
char c=0;
c=getch();
if (c=='o'||c=='O')
{
setfillstyle(SOLID_FILL,GREEN);
floodfill(458,97,WHITE);
setcolor(RED);
outtextxy(458,97,"ON");
}
else if (c=='1')
{
setfillstyle(SOLID_FILL,GREEN);
floodfill(382,357,WHITE);
setcolor(RED);
outtextxy(382,357,"1");
outtextxy(450,70,"1");
delay (200);
setfillstyle(EMPTY_FILL,GREEN);
floodfill(382,357,WHITE);
setcolor(RED);
outtextxy(382,357,"1");
}
getch();
cleardevice();
settextstyle(10,0,5);
outtextxy(xmax/2-150,ymax/2-100,"EXITING");
x=xmax/2+100;
y=ymax/2-100;
setbkcolor(YELLOW);
for (int i=1;i<=5;i++)
{

outtextxy(x,y,".");
x=x+20;
delay(500);
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006