There are numerous graphics functions available in c. But let us see some to have an understanding of how and where a pixel is placed in each when each of the graphics function gets invoked.
Function:
putpixel(x, y, color)
Purpose:
The functionality of this function is it put a pixel or in other words a dot at position x, y given in inputted argument. Here one must understand that the whole screen is imagined as a graph. In other words the pixel at the top left hand corner of the screen represents the value (0, 0).
Here the color is the integer value associated with colors and when specified the picture element or the dot is placed with the appropriate color associated with that integer value.
Function:
Line(x1, y1, x2, y2)
Purpose:
The functionality of this function is to draw a line from (x1,y1) to (x2,y2).Here also the coordinates are passed taking the pixel (0,0) at the top left hand corner of the screen as the origin. And also one must note that the line formed is by using number of pixels placed near each other.
Function:
getpixel(x, y)
Purpose:
This function when invoked gets the color of the pixel specified. The color got will be the integer value associated with that color and hence the function gets an integer value as return value.
So the smallest element on the graphics display screen is a pixel or a dot and the pixels are used in this way to place images in graphics screen in C language.
Author: SriPriya