Graphics.....!1

Hi dears...!!
i have started Graphics in C++...!!
But i dont know about BGI(Borland Graphics interface) how it works...!!
even How X-Y coordinates works on console...!!
as it works normally (80,25)...!!
plz help me Out ...!!
closed account (18hRX9L8)
Yeah, I am using BGI too on Dev C++.

Here is a website that explains how to download it and use it:
http://www.cs.colorado.edu/~main/bgi/dev-c++/


Note: you have to use a project for the parameters.

Here is the website for the functions:
http://www.cs.colorado.edu/~main/bgi/doc/


Now, the x,y coordinates work like they normally do on a graph except it is upside down.

For example, here is the imaginary graph on the console.

..................................10
0...---------------------------x
.....|
.....|
.....|
.....|
.....|
10.|
.....y

Now, if I want to put a dot in coordinate (100,50), here would where the pixel is on a 200x200 console.

...................................200
.0....---------------------------x
.......|
.......|................*
.......|
.......|
.......|
200.|
.......y

EDIT: Sorry about the graphs, i have put dots but ignore them as spaces.

Here is a program that does that.

1
2
3
4
5
6
7
8
9
10
11
#include <graphics.h>

main()
{
    initwindow(200, 200, "Example.exe"); //to create the console for BGI. Includes the name.
    putpixel(100,50,10); //to put a pixel. It is putpixel(int x,int y,int color).
    
getchar();
closegraph(); //closes the console when user presses enter
getchar(); //now, it is the main window.
}
Last edited on
a bundle of thankx dear..!!
Topic archived. No new replies allowed.