Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Computer GraphicsRSS Feeds

Program to display different type of progress bar as displayed in windows system

Posted By: Easy Tutor     Category: C Programming     Views: 5629

Write a Program to display different type of progress bar as displayed in windows system.

Code for Program to display different type of progress bar as displayed in windows system in C Programming

#include <stdio.h>
#include <conio.h>
#include <dos.h>

/*start_x    :  x-axis starting (progressbar starting[x-cordinate])end_x      :  x-axis ending   (progressbar ending[x-cordinate])y          :  Row no. where progressbar should be placedsymbol     :  Symbol to be displayedstyle      :  0 for smooth progressbar          1 for rough progressbardlytime    :  delay time (in milliseconds)fillclr    :  fill color for progressbarfillbkclr  :  fill backcolor for progressbarcolor may be from following option...Constant      ³ValueÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍ BLACK        ³  0 BLUE         ³  1 GREEN        ³  2 CYAN         ³  3 RED          ³  4 MAGENTA      ³  5 BROWN        ³  6 LIGHTGRAY    ³  7 DARKGRAY     ³  8 LIGHTBLUE    ³  9 LIGHTGREEN   ³ 10 LIGHTCYAN    ³ 11 LIGHTRED     ³ 12 LIGHTMAGENTA ³ 13 YELLOW       ³ 14 WHITE        ³ 15*/void progressbar(int start_x,int end_x,int y,char symbol,int style,int dlytime,int fillclr,int fillbkclr)
{
 int i,len,temp,dly;
 len=end_x-start_x;
 dly=dlytime/len;

 _setcursortype(_NOCURSOR);

 textbackground(fillbkclr);
 temp=start_x;
 for (i=1;i<=len+1;++i,++start_x)
 {
   gotoxy(start_x,y);
   cprintf("%c",symbol);
 }
 start_x=temp;
 gotoxy(start_x,y);


 textbackground(fillclr);
 temp=start_x;
 for (i=1;i<=len+1;++i,++start_x)
 {
   if(style==1){
    if(i%2!=0){
      gotoxy(start_x,y);
      delay(dly);
      cprintf("%c",symbol);
     }
    }
   else{
      gotoxy(start_x,y);
      delay(dly);
      cprintf("%c",symbol);
   }
 }

 gotoxy(temp,y+1);
  _setcursortype(_NORMALCURSOR);

}

void main(){
clrscr();
/*examples*/
progressbar(20,50,12,' ',0,2000,BLUE,LIGHTGRAY);
progressbar(10,70,14,' ',0,500,RED,YELLOW);
progressbar(30,40,16,' ',0,15000,MAGENTA,LIGHTGREEN);
getch();
}
  
Share: 



Easy Tutor
Easy Tutor author of Program to display different type of progress bar as displayed in windows system is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!