Creating loading screen in C-Program
As we all have seen that every software has their loading screen, we may want to add loading screen to our C programming project. Although we don't have anything to load we can add it to our project to make it look more attractive.
Header files used:
1. conio.h
- It is used because getch( ) function is defined in this header file.
2.ctype.h
- It is used because delay( ) function is defined in this header file.
3.graphics.h
- It is used because of all the graphics function like settextstyle( ), setcolor( ), setbkolor( ), initgraph( ), closegraph( ).
Code:
#include<conio.h>
#include<graphics.h>
#include<ctype.h>
void loading();
void main()
{
int gm,gd=DETECT;
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
loading();
closegraph();
}
void loading()
{
int i;
setbkcolor(BLUE);
settextstyle(0,0,2);
outtextxy(210,250,"Code In Nepal");
rectangle(185,300,475,310);
for(i=0;i<322;i++)
{
setcolor(10);
rectangle(205,300,155+i,304);
setcolor(WHITE);
rectangle(205,304,155+i,306);
setcolor(GREEN);
rectangle(205,306,155+i,310);
delay(4);
}
cleardevice();
setbkcolor(BLUE);
outtextxy(100,250,"Welcome to Code In Nepal");
getch();
}
HAPPY CODING😊😊
I was searching for this video so long..thanks
ReplyDeleteWow..This solved my problem.Thanks
ReplyDelete