getcolor function
getcolor function returns the current drawing color.
Declaration : int getcolor();
e.g. a = getcolor(); // a is an integer variable
if current drawing color is WHITE then a will be 15.
See colors in c graphics.
getcolor function returns the current drawing color.
Declaration : int getcolor();
e.g. a = getcolor(); // a is an integer variable
if current drawing color is WHITE then a will be 15.
See colors in c graphics.
#include<graphics.h>
#include<conio.h>
main()
{
int gd = DETECT, gm, drawing_color;
char a[100];
initgraph(&gd,&gm,"C:\\TC\\BGI");
drawing_color = getcolor();
sprintf(a,"Current drawing color = %d", drawing_color);
outtextxy( 10, 10, a );
getch();
closegraph();
return 0;
} Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I'm a frequent speaker at tech conferences and events.
Our site uses cookies. By using this site, you agree to the Privacy Policy and Terms of Use.