graphdefaults function resets all graphics settings to their defaults.
Declaration :- void graphdefaults();
It resets the following graphics settings :-
#include <graphics.h> #include <conio.h> main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); setcolor(RED); setbkcolor(YELLOW); circle(250, 250, 50); getch(); graphdefaults(); getch(); closegraph(); return 0; }
In the above program we have first changed the drawing color to RED and background color to YELLOW and then drawn a circle with (250, 250) as center and 50 as radius. When the user will press a key graphdefaults is called and both drawing and background color will be reset to their default values i.e. WHITE and BLACK respectively. See colors in c graphics.