getpixel() function
getpixel function returns the color of pixel present at location(x, y).
Declaration of getpixel() function
int getpixel(int x, int y);
C program for getpixel()
#include<graphics.h>
#include<conio.h>
main()
{
int gd = DETECT, gm, color;
char array[50];
initgraph(&gd,&gm,"C:\\ TurboC3\\BGI");
color = getpixel(0, 0);
sprintf(array,"color of pixel at (0,0) = %d",color); outtext(array);
getch();
closegraph();
return 0;
}