{"id":24792,"date":"2017-09-08T17:46:34","date_gmt":"2017-09-08T12:16:34","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=24792"},"modified":"2017-09-08T17:46:34","modified_gmt":"2017-09-08T12:16:34","slug":"getpixel-function-c","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/getpixel-function-c\/","title":{"rendered":"getpixel function in c"},"content":{"rendered":"<p>getpixel function returns the color of pixel present at location(x, y).<\/p>\n<p>Declaration :- int getpixel(int x, int y);<\/p>\n<h2 id=\"c-program-for-getpixel\">C program for getpixel<\/h2>\n[pastacode lang=\u201dc\u201d manual=\u201d%23include%3Cgraphics.h%3E%0A%23include%3Cconio.h%3E%0A%20%0Amain()%0A%7B%0A%20%20int%20gd%20%3D%20DETECT%2C%20gm%2C%20color%3B%0A%20%20char%20array%5B50%5D%3B%0A%20%0A%20%20initgraph(%26gd%2C%26gm%2C%22C%3A%5C%5CTC%5C%5CBGI%22)%3B%0A%20%0A%20%20color%20%3D%20getpixel(0%2C%200)%3B%0A%20%0A%20%20sprintf(array%2C%22color%20of%20pixel%20at%20(0%2C0)%20%3D%20%25d%22%2Ccolor)%3B%0A%20%20outtext(array)%3B%0A%20%0A%20%20getch()%3B%0A%20%20closegraph()%3B%0A%20%20return%200%3B%0A%7D\u201d message=\u201d\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n<p>As we haven\u2019t drawn anything on screen and by default screen is BLACK, therefore color of pixel at (0,0) is BLACK. So output of program will be color of pixel at (0,0) is 0, as 0 indicates BLACK color.<\/p>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>getpixel function in c &#8211; c programming -getpixel function returns the color of pixel present at location(x, y).Declaration :- int getpixel(int x, int y);<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[82961,82964,75068,82995,82998,83001,82996,82999,82997,83000],"class_list":["post-24792","post","type-post","status-publish","format-standard","hentry","category-coding","tag-difference-between-setpixel-and-putpixel","tag-draw-circle-using-putpixel","tag-function-program-in-c","tag-getpixel-c","tag-getpixel-function-python","tag-gets-function-in-c","tag-putpixel-function-in-graphics","tag-setpixel-function-in-c-language","tag-setpixel-function-in-computer-graphics","tag-write-a-program-to-draw-a-pixel-in-c"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=24792"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24792\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=24792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=24792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=24792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}