My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

program to show the basics os screen saver

Tuesday, September 1, 2009

#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<alloc.h>
#include<stdlib.h>
void main()
{       clrscr();
    int gd=DETECT,gm,area;
    initgraph(&gd,&gm,"c:/tc");
    void *buff,*buff1;
    setbkcolor(WHITE);
    setcolor(RED);
    setfillstyle(1,RED );
    circle(10,10,9);
    floodfill(10,10,RED);
    area=imagesize(1,1,20,20);
    buff=malloc(area);
    getimage(1,1,20,20,buff);

    setcolor(WHITE);
    setfillstyle(1,WHITE );
    rectangle(1,1,20,20);
    circle(10,10,9);
    floodfill(10,10,WHITE);
    area=imagesize(1,1,20,20);
    buff1=malloc(area);
    getimage(1,1,20,20,buff1);
    for(int i=0;i<500;i++)
    {     //  i=i+10;
        putimage(i,50,buff,0);
        delay(20);
        putimage(i,50,buff1,0);
    }
    getch();
}

0 comments: