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 draw 2 rectangles and fill 1 of them


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

void main()
{
clrscr();
int gd = DETECT,gm,errorcode; //Requesting auto-detection.

//Initializing graphics and local variables.
initgraph (&gd, &gm, "d:\\bc3\\bgi"); //Path where graphics drivers are installed

//Read result of initialization.
errorcode = graphresult();

//An error occured.
if (errorcode != grOk)
{
cout << "Graphics error occured : \n" << grapherrormsg(errorcode) << endl;
cout << "Press any key to stop : ";
getch();
exit(1);
}

/*Drawing a rectangle having top LHS vertex at (300, 300)
and bottom RHS vertex at (600, 400)*/
rectangle(300, 300, 600, 400);
rectangle(100, 100, 200, 200);
getch();
floodfill(120, 120, WHITE);
getch();
closegraph();
}
This graphics program draws two rectangles, but fills in only one of them with a white color using the 'floodfill' command.
Attached Files
File Type: docx Program to draw 2 rectangles and fill 1 of them(www.bzupages.com).docx (12.6 KB, 50 views)
__________________

Reply With Quote
Top 10 Lists | Live Cricket Score

Reply

Tags
draw, fill, program, rectangles


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
C-Sharp Program Double Linked List (All Functions In One Program) thecool Visual Programming 0 17-06-2011 08:58 PM
Program to change the foreground colors and draw circles on the screen bonfire Object Oriented Programming 0 01-03-2011 03:01 PM
Program to draw circles bonfire Object Oriented Programming 0 01-03-2011 02:59 PM
Sand Draw... (World Largest Art) Raheel Designed Pictures 0 13-08-2010 12:22 PM
Anti-draw-muhammad (p.b.u.h) -day .BZU. Tech world 0 19-05-2010 06:09 PM

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.