The Graphics.h File Is Used in C Language To Get Basic Graphics Working in C
The Graphics.h File Is Used in C Language To Get Basic Graphics Working in C
POSITION TRACKING
The positioning is done from the top left corner as shown in the image below,
Cleardevice() Clears screen gotoxy() Moves the cursor to a specific location on screen putpixel() Puts a small pixel(a very small dot) at the location mentioned in the function. outtextxy() Prints a text on the screen. rectangle()
Draws a rectangle, given its starting and ending diagonal co-ordinates. circle() Draws a circle, given the coordinates of centre and the radius. line() Draws a line, given the starting and ending co-ordinates of the line. moveto() Moves the cursor, from one place to the position mentioned in the function. lineto() Draws a line from the current position to the co-ordinates specified. ellipse() Draws the ellipse using the specified angles and coordinates. drawpoly() Draws a polygon. settextstyle() Sets the font style. The available fonts are,
1. TRIPLEX_FONT 2. SMALL_FONT 3. SANS_SERIE_FONT 4. GOTHIC_FONT You may change the direction of the text to be displayed horizontally or vertically using HORIZ_DIR or VERT_DIR respectively.
You may also change the size. The size is from 1 to 10. setfillstyle() Sets a style to fill up a shape. Styles available are SOLID_FILL, LINE_FILL, HATCH_FILL, SLASH_FILL etc. setcolor() Sets the color floodfill() Fills up the selected area with color. itoa() Converts from integer to alphabet. delay() Causes a delay in the execution of the program. The delay is given in