 Hello friends, I am Sanjay Gupta, in this video I am going to demonstrate you the use of getPixel function which is used to find out color of a particular position. Before starting, you can subscribe my youtube channel by clicking on the link which is available at bottom right corner of this video. You can download my app Techimage that is available on google play. You can connect with me by following these details which are available in front of you. Now coming on to the code, I have included two hydrophys, conio and graphics.h, then inside main function I have declared three variables gd, gm and color. All three variables are of integer type, gd is initialized with detect, it will automatically detect graphics driver, gm is for graphics mode and color is to store the color value which I will be identifying using getPixel function. Then str array is declared which is of character type. Then init graph function is initializing graphics. It has three arguments, first is graphics driver, second graphics mode and third one is a path which is for c, tc and bgi, bgi contains all graphics library, that's why this path is provided here. Now first I am setting the color to green. Now I am calling getPixel function and I am identifying 100 by 100 pixels color that color code value will be stored inside the color variable. Now I am using sprintf function here str, inside double quotes, inside double quotes I have typed this content color value of 100 is and percent d, this percent d will be replaced by the variable color, color will be having a value that will be placed on a percent d position and this complete string will be assigned into str. Now to print this str on console I am using a function out text xy, this will display text on 10, 20 coordinates. Then getCH function will hold the screen, then close graph will deallocate all the graphics which are initialized. Then return type of main is integer, that's why return0 statement is written here. Now I am executing this code. You can see it is showing color value of 100, 100 is 0. So right now background color is black and on 100, 100 coordinate position black color is available and numerical value of black is 0. We can see here I am showing the list of colors to you so that you can identify the values. You can see black color value is 0. Now I will be using red color whose value is 4. For that purpose first I am setting the color into red. Now I will be drawing a circle on 100, 100 coordinate and radius of circle is 50. Now I am applying set fill style, I am filling it with solid fill style and color will be red. Then I am using flood fill on 100, 100 coordinates it will create a boundary of red color. So circle will be drawn in red color, it will be filled with red color. Then green color will be set. Now get pixel will be identifying color of 100, 100 coordinate. So now it will be identifying red color. So I am executing this code. Let's see what happens now. You can see circle is drawn in red color and color value of 100, 100 is now 4. I have already demonstrated you that red color numerical value is 4. So friends with the help of this get pixel function you can identify color of a particular position and that color will be available in a numerical value. So you can display that color value or you can use that color value for any other purpose also. If you want to watch more programming related videos you can subscribe my youtube channel that is sanjaygupta underscore tax school. Thank you for watching this video.