HOME BZU Mail Box Online Games Radio and TV Live Cricket Score All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Institute of Computing Bachelor of Science in Information Technology BsIT 2nd Semester Object Oriented Programming

Advertisement Banner

Program to change the background colors on the screen


#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>

void main (int)
{
int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection.
int midx,midy,x;
//Initializing graphics and local variables.
initgraph(&gdriver,&gmode,"d:\\bc3\\bgi");
//Reading result of initialization.
errorcode=graphresult();
if(errorcode!=grOk)
//An error occurred.
{
printf("Graphics error occurred : %s \n",grapherrormsg(errorcode));
printf("Press any key to stop : ");
getch();
exit(1); //Terminate the program due to error.
}
/*Changing the background color.
Note : Press enter to see the first screen as it is black and
it may appear as if the program has stopped running.*/
for(x=0;x<=15;x++)
{
setbkcolor(x);
getch();
}
closegraph();
}
This graphics program changes the background colors on the screen gradually from black to white using the 'setbkcolor' command.
Attached Files
File Type: docx Program to change the background colors on the screen(www.bzupages.com).docx (11.9 KB, 69 views)
__________________

Reply With Quote
Top 10 Lists | Live Cricket Score

Reply

Tags
background, change, colors, program, screen


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to write in different fonts on the screen bonfire Object Oriented Programming 0 01-03-2011 03:02 PM
Program to change the foreground colors and draw circles on the screen bonfire Object Oriented Programming 0 01-03-2011 03:01 PM
Change logon Background screen usman_latif_ch PC and Windows Tutorial 0 07-06-2009 04:47 PM
Trick -- Change folder BackGround mrabyan PC and Windows Tutorial 1 07-06-2009 09:54 AM

Best view in Firefox
Free File Hosting | Webmaster Forum | Cloud Computing | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 12:53 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.