{"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<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-c code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-c code-embed-code\">#include&lt;graphics.h&gt;<br\/>#include&lt;conio.h&gt;<br\/> <br\/>main()<br\/>{<br\/>  int gd = DETECT, gm, color;<br\/>  char array[50];<br\/> <br\/>  initgraph(&amp;gd,&amp;gm,&quot;C:\\\\TC\\\\BGI&quot;);<br\/> <br\/>  color = getpixel(0, 0);<br\/> <br\/>  sprintf(array,&quot;color of pixel at (0,0) = %d&quot;,color);<br\/>  outtext(array);<br\/> <br\/>  getch();<br\/>  closegraph();<br\/>  return 0;<br\/>}<\/code><\/pre> <\/div>\n<p>As we haven&#8217;t 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>&nbsp;<\/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}]}}