VOOZH about

URL: https://www.geeksforgeeks.org/c/getpixel-function-c/

⇱ getpixel() function in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

getpixel() function in C

Last Updated : 23 Jan, 2018
The header file graphics.h contains getpixel() function which returns the color of pixel present at location (x, y). Syntax :
int getpixel(int x, int y);
Note : By default the screen is BLACK, therefore color of pixel at (0,0) is BLACK. Below is the implementation of getpixel() function. Output :
👁 Image
Explanation : As nothing is drawn anything on screen and by default screen is BLACK, therefore color of pixel at (0, 0) is BLACK as 0 indicates BLACK color.
Comment