{"id":24823,"date":"2017-09-07T18:20:37","date_gmt":"2017-09-07T12:50:37","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=24823"},"modified":"2017-09-07T18:20:37","modified_gmt":"2017-09-07T12:50:37","slug":"putpixel-function-c","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/putpixel-function-c\/","title":{"rendered":"putpixel function in c"},"content":{"rendered":"<p>putpixel function plots a pixel at location (x, y) of specified color.<\/p>\n<p>Declaration :- void putpixel(int x, int y, int color);<\/p>\n<p>For example if we want to draw a GREEN color pixel at (35, 45) then we will write putpixel(35, 35, GREEN); in our c program, putpixel function can be used to draw circles, lines and ellipses using various algorithms.<\/p>\n[ad type=&#8221;banner&#8221;]\n<h2 id=\"c-programming-code-for-putpixel\">C programming code for putpixel<\/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;<br\/> <br\/>   initgraph(&amp;gd, &amp;gm, &quot;C:\\\\TC\\\\BGI&quot;);<br\/> <br\/>   putpixel(25, 25, RED);<br\/> <br\/>   getch();<br\/>   closegraph();<br\/>   return 0;<br\/>}<\/code><\/pre> <\/div>\n<p>Output of this program will be a RED pixel on screen at (25, 25) . Try to spot that pixel with your eyes at left top portion of your computer screen.<br \/>\n[ad type=&#8221;banner&#8221;]\n","protected":false},"excerpt":{"rendered":"<p>putpixel function in c &#8211; c programming &#8211; putpixel function plots a pixel at location (x, y) of specified color. Declaration  void putpixel<\/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,7385,82959,82966,82962,82965,82960,82963],"class_list":["post-24823","post","type-post","status-publish","format-standard","hentry","category-coding","tag-difference-between-setpixel-and-putpixel","tag-draw-circle-using-putpixel","tag-functions-in-c","tag-putpixel-and-getpixel-in-graphics","tag-putpixel-definition","tag-putpixel-in-turbo-c","tag-putpixel-parameters-in-graphics","tag-setpixel-in-computer-graphics","tag-use-of-putpixel-in-graphics"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24823","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=24823"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24823\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=24823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=24823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=24823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}