Saturday, August 15, 2020

How to create loading screen in C-Program.

 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😊😊

2 comments:

Creating a photo manipulation in Photoshop

Every one wants to change the photo from "what they see "to" what they want to see" . And photoshop handy in this case. ...

Popular posts that you may be interested on