initgraph()
|
Colors
Color | Value |
BLACK | 0 |
BLUE | 1 |
GREEN | 2 |
CYAN | 3 |
RED | 4 |
MAGENTA | 5 |
BROWN | 6 |
LIGHTGRAY | 7 |
DARKGRAY | 8 |
LIGHTBLUE | 9 |
LIGHTGREEN | 10 |
LIGHTCYAN | 11 |
LIGHTRED | 12 |
LIGHTMAGENTA | 13 |
YELLOW | 14 |
WHITE | 15 |
Declaration:
Remarks:
|
The parameter pattern in setfillstyle is as follows:
Names | Value | Means Fill With... |
EMPTY_FILL | 0 | Background color |
SOLID_FILL | 1 | Solid fill |
LINE_FILL | 2 | --- |
LTSLASH_FILL | 3 | /// |
SLASH_FILL | 4 | ///, thick lines |
BKSLASH_FILL | 5 | \\\, thick lines |
LTBKSLASH_FILL | 6 | \\\ |
HATCH_FILL | 7 | Light hatch |
XHATCH_FILL | 8 | Heavy crosshatch |
INTERLEAVE_FILL | 9 | Interleaving lines |
WIDE_DOT_FILL | 10 | Widely spaced dots |
CLOSE_DOT_FILL | 11 | Closely spaced dots |
USER_FILL | 12 | User-defined fill pattern |
setfillstyle function sets the current fill pattern and fill color.
floodfill
void floodfill(int x, int y, int border);
floodfill function is used to fill an enclosed area.
(x, y) is any point on the screen if (x,y) lies inside the area
then inside will be filled otherwise outside will be filled.
Border specifies the color of boundary of area.
To change fill pattern and fill color use setfillstyle.
Text
(setcolor() works for the below)outtext()void outtext(char *textstring);outtextxy()void outtextxy(int x, int y, char *textstring);
settextstyle()
void settextstyle(int font, int direction, int charsize);
A call to settextstyle affects all text output by outtext and outtextxy.
Name | Value | Description |
DEFAULT_FONT | 0 | 8x8 bit-mapped font |
TRIPLEX_FONT | 1 | Stroked triplex font |
SMALL_FONT | 2 | Stroked small font |
SANS_SERIF_FONT | 3 | Stroked sans-serif font |
GOTHIC_FONT | 4 | Stroked gothic font |
SCRIPT_FONT | 5 | Stroked script font |
SIMPLEX_FONT | 6 | Stroked triplex script font |
TRIPLEX_SCR_FONT | 7 | Stroked triplex script font |
COMPLEX_FONT | 8 | Stroked complex font |
EUROPEAN_FONT | 9 | Stroked European font |
BOLD_FONT | 10 | Stroked bold font |
DIRECTION:
The direction can be changed to VERT_DIR from the default HORIZ_DIR
SIZE:
Font size acts like a magnifying factor. Default or 1 is 8x8 bit character.
Using 2, doubles it, making it 16x16.
EXAMPLE:
settextstyle(5, HORIZ_DIR, 1);
Circles, arc, pieslice
Declaration:
Remarks:
Arguments:
|