Function
|
Declaration
|
Description
|
initgraph
|
void initgraph(int *graphdriver, int *graphmode, char *pathtodriver);
|
Initializes the graphics system. To start the graphics system
you must first call initgraph.
|
line
|
void line(int x1, int
y1, int x2, int y2);
|
Line draws a line between two specified points.
|
circle
|
void circle(int x, int
y, int radius);
|
Circle draws a circle in current drawing color.
|
ellipse
|
void ellipse(int x,int
y, int stangle, int endangle, int xradius, int yradius);
|
Draws an elliptical arc in the current drawing color.
|
getx
|
int getx(void);
|
Returns the current position’s x coordinate.
|
putx
|
int getx(void);
|
Returns the current position’s x coordinate.
|
setcolor
|
void setcolor(int
color);
|
Setcolor sets the current drawing color to color, which can
range from 0 to getmaxcolor.
|
setbkcolor
|
void setbkcolor(int
color);
|
Setbkcolor sets the current background to the specified color.
|
arc
|
void arc(int x, int y,
int endangle, int radius);
|
arc draws a circular arc in the current drawing color.
|
pieslice
|
void pieslice(int x,
int y, int stangle, int endangle, int radius);
|
Pieslice draws a pie slice in the current drawing color, then
fills it using the current fill pattern and fill color.
|
bar
|
void bar(int left, int
top, int right, int bottom);
|
Bar draws a filled in, rectangular, two-dimensional bar. The
bar is filled using the current fill pattern and fill color.
|
bar3d
|
void bar3d(int left,
int top, int right, int bottom, int depth, int topflag);
|
Bar3d draws a three- dimensional rectangular bar, and then
fills it using the current fill pattern and fill color. The three dimensional
outline of the bar is drawn in the current line style and color. Topflag
governs whether a three dimensional top is put on the bar. Outline bar can be
drawn by assigning depth=0. If topflag is nonzero, a top is put on the bar.
If topflag is zero, no top is put on the bar.
|
cleardevice
|
void cleardevice(void);
|
Clear device erases the entire graphics screen and moves the
current position to home (0,0).
|
closegraph
|
void closegraph(void);
|
Shuts down the graphics system. Close graph deallocates all
memory allocated by the graphics system.
|
drawpoly
|
void drawpoly(int
numpoints, int *polypoints);
|
Drawpoly draws outline of a polygon using the current line
style and color.
|
fillpoly
|
void fillpoly(int
numpoints, int *polypoints);
|
Fillpoly draws the outline of a polygon using the current line
style and color, then fills the polygon using current fill pattern and fill
color.
|
fillellipse
|
void fillellipse(int x,
int y, int xradius, int yradius);
|
It draws an ellipse, and then fills the ellipse with the
current fill color and pattern.
|
sector
|
void sector(int x, int
y, int stangle, int endangle, int xradius, int yradius);
|
Draws and fills an elliptical pie slice.
|
getimage
|
void getimage(int left,
int top, int right, int bottom, void *bitmap);
|
Getimage saves a bit image of the specified region into
memory.
|
putimage
|
void putimage(int left,
int top, void *bitmap, int op);
|
putimage puts the bit image previously saved with getimage
back onto the screen, with the upper left corner of the image placed at
(left, top);
|
getmaxcolor
|
int getmaxcolor(void);
|
Getmaxcolor returns the highest valid color value that can be
passed to the setcolor for current graphics driver and mode.
|
getmaxx
|
int getmaxx(void);
|
it returns the maximum screen related x value for the current
graphics driver and mode.
|
getmaxy
|
int getmaxy(void);
|
it returns the maximum screen related y value for the current
graphics driver and mode.
|
gety
|
int gety(void);
|
returns the current position’s y coordinate
|
graphresult
|
int graphresult(void);
|
Returns an error code for the last unsuccessful graphics
operation.
|
lineto
|
void lineto(int x, int
y);
|
Lineto draws a line from the current position to (x,y).
|
outtext
|
void outtext(char *textstring);
|
Outputs textstring at the current position.
|
outtextxy
|
void outtextxy( intx,
int y, char *textstring);
|
Displays textstring in the viewport at the position (x,y).
|
rectangle
|
void rectangle(int
left, int top, int right, int bottom);
|
Draws a rectangle in the current line style, thickness, and
drawing color.
|
setfillpattern
|
void
setfillpattern(char *upattern,
int color);
|
Setfillpattern sets the current fill pattern to a user-defined
8x8 pattern.
|
setfillstyle
|
void setfillstyle(int
pattern, int color);
|
Sets the fill pattern and color.
|
setlinestyle
|
void setlinestyle(int
line style, unsigned upattern, int thickness);
|
sets the style for all lines drawn by line, lineto, rectangle,
drawpoly, etc.
|
settextjustify
|
void settextjustify(int
horiz, int vert);
|
Settext justification for graphics mode.
|
settextstyle
|
void settextstyle ( int
font, int direction, int charsize);
|
Settextstyle sets the text font, the direction in which text
is displayed, and the size of the characters.
|