473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why Graphics are not supported under Windows(Borland C++ 5.01

3
"BGI Graphics are not supported under Windows" - I`ve got this message working in Borland C++ 5.01.
File (house.cpp) should include graphics.

Project contents: home.cpp;
myheader.h

Myheader.h contents:
#include<conio.h>
#include<ctype.h>
#include<dos.h>
#include<fstream.h>
#include<io.h>
#include<iostream.h>
#include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<cstring.h>

Home.cpp contents:
// using borland graphics to construct a house
// house.ide (house.cpp) 17-03-04

#include"myheader.h"
#include<graphics.h>

// prototype functions
void house();
void lorry();

void main()
{
int select = 3;

do
{
textbackground(1);
clrscr();
cout << "\n\nBasic graphical shapes: House and Lorry\n\n";
textcolor(14);
cprintf("Menu: Please select an option");
cout << "\n\n";
textcolor(10);
cprintf("1. Select a HOUSE diagram");
cout << "\n";
cprintf("2. Select a LORRY diagram");
cout << "\n";
cprintf("3. Exit the program");
cout << "\n\n";
textcolor(15);
cprintf("Enter 1, 2 or 3 (to end): ");
cin >> select;
switch ( select )
{
case 1 : house(); break;
case 2 : lorry(); break;
case 3 : cout << "\n\n\tProgram Exit (press enter) "; break;
default :
cout << "\n\n\tEnter correct value please (press enter): ";
getch();
} // end switch/case
} // end do/while loop
while ( select != 3 );

getch();
} // end main

void house()
{
int gd = DETECT, gm;
// open the graphics window
initgraph(&gd,&gm,"f:\\bc5\\bgi");

// set background colour
clrscr();
setbkcolor(BLUE);
//clrscr();

// basic house shape
bar(200,150,600,420);
setcolor(BLACK);
rectangle(200,150,600,420);

// front door
setfillstyle(1,4);
bar(370,310,430,420);
setcolor(YELLOW);
outtextxy(390,330,"154");
rectangle(370,310,430,420);
setfillstyle(1,15);
fillellipse(420,370,4,4);

// basic garage shape
setfillstyle(2,RED);
bar(50,280,200,420);
rectangle(50,280,200,420);
setfillstyle(1,15);
fillellipse(125,410,7,4);
//moveto(50,280); lineto(200,200);
// garage roof
setfillstyle(9,RED);
setbkcolor(3);
int poly1[6];
poly1[0] = 50;
poly1[1] = 280;
poly1[2] = 200;
poly1[3] = 200;
poly1[4] = 200;
poly1[5] = 280;
fillpoly(3,poly1);


// windows (left upstairs)
setfillstyle(1,10);
bar(220,180,370,270);
setcolor(BROWN); // window frame
rectangle(220,180,370,270);
moveto(220,225); lineto(370,225);
moveto(295,180); lineto(295,270);
setfillstyle(1,12); // window ledge
bar(215,270,375,280);

// right upstairs
setfillstyle(1,10);
bar(430,180,580,270);
setcolor(BROWN); // window frame
rectangle(430,180,580,270);
moveto(430,225); lineto(580,225);
moveto(505,180); lineto(505,270);
setfillstyle(1,12); // window ledge
bar(425,270,585,280);

// right downstairs
setfillstyle(8,10);
bar(460,300,570,390);
setcolor(BROWN);
rectangle(460,300,570,390);
moveto(460,345); lineto(570,345);
moveto(515,300); lineto(515,390);
setfillstyle(1,12); // window ledge
bar(455,390,575,400);

// left downstairs
setfillstyle(8,10);
bar(230,300,340,390);
setcolor(BROWN);
rectangle(230,300,340,390);
moveto(230,345); lineto(340,345);
moveto(285,300); lineto(285,390);
setfillstyle(1,12); // window ledge
bar(225,390,345,400);


// basic roof shape
bar(300,10,350,50);
rectangle(300,10,350,50);
// set up an array for the polygon
setfillstyle(8,RED);
setbkcolor(3);
int poly[8];
poly[0] = 200; // first x position
poly[1] = 150; // first y position
poly[2] = 250; // second x position
poly[3] = 50; // second y position
poly[4] = 550; // third x position
poly[5] = 50; // third y position
poly[6] = 600; // final x position
poly[7] = 150; // final y position
// place the polygon on the diagram
fillpoly(4,poly);

setfillstyle(1,15);
fillellipse(60,60,30,30);

setfillstyle(1,7);
fillellipse(60,60,3,2);
moveto(60,60); lineto(50,50); lineto(40,60);
moveto(60,60); lineto(70,50); lineto(80,60);

getch();
closegraph();

} // end house

// lorry function
void lorry()
{

int gd = DETECT, gm;
// open the graphics window
initgraph(&gd,&gm,"f:\\bc5\\bgi");

// lorry shape

"f:\\bc5\\bgi" - stored at 2-nd HD(f).

Thanks for answer for the previous question.

getch();
closegraph();

} // end lorry
Mar 29 '07 #1
2 8268
axneer
8
"BGI Graphics are not supported under Windows" - I`ve got this message working in Borland C++ 5.01.
TRY this--

--right click on your text editor and select ' TargetExpet'
--under 'Platform' drop down menu select ' DOS(standard)'
--under 'libraries' check 'BGI'
--compile the program
Jun 24 '07 #2
rsr
25
If I try to compile this way, it doesn't compile at all, but shows no errors.
Jul 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Rick Muller | last post by:
I have a problem that I would like to get some advice on from other Pythonistas. I currently manage a (soon to be) open source project for displaying molecular graphics for a variety of different...
1
by: Deepak Gupta | last post by:
Dear sir , I have a problem with my cpp compiler. I have terbo(borland) 3.0 & 4.5 both compiler compiler but compling a graphics.h header file it shows an error that BGI graphics not supported in...
5
by: Carl | last post by:
Hi, I am studying C++ right now. I am interested in creating my own mathematical software. Do you have any suggestions on the libraries or std libraries that I can use to creat very simple graphics...
12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
1
by: James dean | last post by:
Could someone explain how this works. I think the graphics card is used to do blitting and drawing shapes like rectangles. How does it draw using the Graphics card on the PC and why is this feature...
2
by: yotaxp | last post by:
Hello, all. This line has been pestering me, and I can't seem to figure out why the problem is occuring. I'm trying to paint a GraphicsPath onto a Bitmap, using the Graphics class, but it...
2
by: Andy | last post by:
Is it possible to use graphics class in web forms? For example DrawArc Method. TAI
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.