Tuesday, July 28, 2009

Anybody can help me in knowing about headerfile <graphic.h> in c- programing language???????

i need to get the main functions used in it. and it`s syntax

Anybody can help me in knowing about headerfile %26lt;graphic.h%26gt; in c- programing language???????
Apart from the obvious: how can I use functionnalities defined in it, I don't see what you are trying to find out.





anyway if that is what you need, this is done by placing this line at the top of your .c file





#include %26lt;graphic.h%26gt;





Otherwise try to be more explicit about what you need
Reply:The file could be different between compilers and operating systems. Which OS are you trying to compile code for and which compiler?





You can simple read the graphics.h file. It's there to set up the definitions for the graphic functions you're including in your program. Alternately you can check the man pages (if unix) or the compiler documentation. There's always third party documentation such as O'Reilly.
Reply:Well I guess, u mean, graphics.h


Here are a few functions:





1. The function to initialise all BGI (Borland graphics Interface) is





initgraph(%26amp;graphdriver,%26amp;graphmode,grap... path);





Here: graphdriver is an integer value having values : MACROS like VGA, EGA, MONO, HERC, if you know what ur driver is. Use graphdriver = DETECT that detects the graphics driver. Graph mode depends on the Graphics driver, so u can leave it blank. And graph path must mention path of the bgi files, u can leave it blank but copy and paste the files in tc\bgi into the source directory





2. To close the graphics functions use:


closegraph();





3. There are many graphics functions, here are only a few:





a. setcolor(integer value 1-15);


Sets the textcolor. (for colors see help for COLORS)





b. setbkcolor(integer value 1-15);


Sets the background color





c. rectangle(int start_point_x_axis, int start_point_y_axis, int end_x, int end_y);


Draws a rectangle





d. circle(int center_x, int centre_y, int radius);


Draws a circle.





There are a million such functions, see SHIFT-F1 help on header file graphics.h from Turbo C++ IDE.


No comments:

Post a Comment