C graphics wont work on my pc

Status
Not open for further replies.

srishet

Broken In
Hello

I have an issue C graphic programming. I have simple circle drawing program. You can view the program code at: *testsrikanth.ipower.com/CIRCLES.txt . I m using Borland C 3.0 version. When I compile it doesn't have any errors. However, When I Run the program, it show blank window and close automatically. Please help me how to run graphics in C program. I am using Atom processor.

Thanks
Srikanth Shet
 
which operating system are you using ?
if its newer than windows xp .. I am afraid you won't be able to run the code.
but if you are using xp ...
the problem could / should be in the path specified in initgraph(&gd, &gm,"")
the thing under quotes is supposed to be
"c:\\tc\\bgi" if your bgi (borland graphics) files are in this directory.

P.S change the path accordingly. It should work.

hope this helps
 
OP
S

srishet

Broken In
I am using Windows XP SP3 Operating System. Could you please tell me how to change the path. I m using Boraland C and it is installed on D:\ drive. However, I have changed the directories of Library, output, include in the Option Menu of C program.
 
xp .. every thing should work fine.
borland C 3.0 .. isn't it called Turbo C++ 3.0?
anyways .. for making things work, as I have already told you. you just need to change the third parameter of the initgraph function. This is what your function should look like:

Code:
initgraph(&gdrive,&gmode,"d:\\tc\\bgi");

the job of the third parameter is to indicate the location of borland graphics interface (bgi) files, mainly egavga.bgi (the driver)

if you don't want to make this change you may also copy the files present in \\bgi folder to the output folder .. (probably the \\bin folder)

this should make it work
 
OP
S

srishet

Broken In
Thank you very much sir. I really appreciated. It works. I just copied the file egavga.bgi to Bin Folder. Once again thank you sir.
 
if in future you would like to incorporate graphical fonts in your 16 bit program .. then copy the font file too to the output directory.

and you're welcome ... anytime
 
Status
Not open for further replies.
Top Bottom