Q:

getpixel function in c using graphics.h

0

getpixel function in c using graphics.h

getpixel function returns the color of pixel present at location(x, y).

Declaration: int getpixel(int x, int y);

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<graphics.h>
#include<conio.h>

main()
{
  int gd = DETECT, gm, color;
  char array[50];

  initgraph(&gd,&gm,"C:\\TC\\BGI");

  color = getpixel(0, 0);

  sprintf(array,"color of pixel at (0,0) = %d",color);
  outtext(array);

  getch();
  closegraph();
  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now