{"id":24852,"date":"2017-10-15T12:05:32","date_gmt":"2017-10-15T06:35:32","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=24852"},"modified":"2018-10-24T11:29:52","modified_gmt":"2018-10-24T05:59:52","slug":"c-smiling-face-animation","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/c-smiling-face-animation\/","title":{"rendered":"C smiling face animation"},"content":{"rendered":"<h2 id=\"c-smiling-face-animation\"><span style=\"color: #ff6600;\">C Smiling Face Animation :<\/span><\/h2>\n<p>This animation using c draws a smiling face which appears at random position on screen. See output below the code, it will help you in understanding the code easily.<\/p>\n<ul>\n<li>The <a href=\"https:\/\/www.wikitechy.com\/technology\/functions-graphics-h-in-c\/\">graphics.h<\/a>\u00a0library is used to create <a href=\"https:\/\/www.wikitechy.com\/technology\/draw-shapes-using-c-graphics\/\" target=\"_blank\" rel=\"noopener\">graphics<\/a> in <a href=\"https:\/\/www.wikitechy.com\/technology\/c-program-to-sort-a-string-in-alphabetic-order\/\" target=\"_blank\" rel=\"noopener\">C program<\/a>. Let us create the smiling face.<\/li>\n<li>Now set the color as YELLOW\u00a0for smiling face. And create circle using <span style=\"color: #800000;\">circle( ) <\/span>function by giving radius parameter.<\/li>\n<li>Using <span style=\"color: #800000;\">setfillstyle( )<\/span> and <span style=\"color: #800000;\">floodfill( )<\/span>\u00a0 fill the yellow color in the circle.<\/li>\n<li>Create 4 ellipse using <span style=\"color: #800000;\">ellipse( )<\/span> <a href=\"https:\/\/www.wikitechy.com\/technology\/fillellipse-function-c\/\" target=\"_blank\" rel=\"noopener\">function <\/a>and fill color BLACK using <span style=\"color: #800000;\">setfillstyle( )<\/span> and <span style=\"color: #800000;\">fillellipse( )<\/span>.<\/li>\n<\/ul>\n<h2 id=\"c-programming-code\"><span style=\"color: #000080;\">C programming code<\/span><\/h2>\n[pastacode lang=\u201dc\u201d manual=\u201d%23include%3Cgraphics.h%3E%0A%23include%3Cconio.h%3E%0A%23include%3Cstdlib.h%3E%0A%20%0Amain()%0A%7B%0A%20%20%20int%20gd%20%3D%20DETECT%2C%20gm%2C%20area%2C%20temp1%2C%20temp2%2C%20left%20%3D%2025%2C%20top%20%3D%2075%3B%0A%20%20%20void%20*p%3B%0A%20%0A%20%20%20initgraph(%26gd%2C%26gm%2C%22C%3A%5C%5CTC%5C%5CBGI%22)%3B%0A%20%0A%20%20%20setcolor(YELLOW)%3B%0A%20%20%20circle(50%2C100%2C25)%3B%0A%20%20%20setfillstyle(SOLID_FILL%2CYELLOW)%3B%0A%20%20%20floodfill(50%2C100%2CYELLOW)%3B%0A%20%0A%20%20%20setcolor(BLACK)%3B%0A%20%20%20setfillstyle(SOLID_FILL%2CBLACK)%3B%0A%20%20%20fillellipse(44%2C85%2C2%2C6)%3B%0A%20%20%20fillellipse(56%2C85%2C2%2C6)%3B%0A%20%0A%20%20%20ellipse(50%2C100%2C205%2C335%2C20%2C9)%3B%0A%20%20%20ellipse(50%2C100%2C205%2C335%2C20%2C10)%3B%0A%20%20%20ellipse(50%2C100%2C205%2C335%2C20%2C11)%3B%0A%20%0A%20%20%20area%20%3D%20imagesize(left%2C%20top%2C%20left%20%2B%2050%2C%20top%20%2B%2050)%3B%0A%20%20%20p%20%3D%20malloc(area)%3B%0A%20%0A%20%20%20setcolor(WHITE)%3B%0A%20%20%20settextstyle(SANS_SERIF_FONT%2CHORIZ_DIR%2C2)%3B%0A%20%20%20outtextxy(155%2C451%2C%22Smiling%20Face%20Animation%22)%3B%0A%20%0A%20%20%20setcolor(BLUE)%3B%0A%20%20%20rectangle(0%2C0%2C639%2C449)%3B%0A%20%0A%20%20%20while(!kbhit())%0A%20%20%20%7B%0A%20%20%20%20%20%20temp1%20%3D%201%20%2B%20random%20(%20588%20)%3B%0A%20%20%20%20%20%20temp2%20%3D%201%20%2B%20random%20(%20380%20)%3B%0A%20%0A%20%20%20%20%20%20getimage(left%2C%20top%2C%20left%20%2B%2050%2C%20top%20%2B%2050%2C%20p)%3B%0A%20%20%20%20%20%20putimage(left%2C%20top%2C%20p%2C%20XOR_PUT)%3B%0A%20%20%20%20%20%20putimage(temp1%20%2C%20temp2%2C%20p%2C%20XOR_PUT)%3B%0A%20%20%20%20%20%20delay(100)%3B%0A%20%20%20%20%20%20left%20%3D%20temp1%3B%0A%20%20%20%20%20%20top%20%3D%20temp2%3B%0A%20%20%20%7D%0A%20%0A%20%20%20getch()%3B%0A%20%20%20closegraph()%3B%0A%20%20%20return%200%3B%0A%7D\u201d message=\u201d\u201d highlight=\u201d\u201d provider=\u201dmanual\u201d\/]\n[ad type=\u201dbanner\u201d]\n<h2 id=\"output\"><span style=\"color: #000080;\">Output :<\/span><\/h2>\n<figure id=\"attachment_31344\" aria-describedby=\"caption-attachment-31344\" style=\"width: 398px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-31344 \" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/10\/smiling-face-animation-1.png\" alt=\"smiling-face-animation\" width=\"398\" height=\"299\" srcset=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/10\/smiling-face-animation-1.png 640w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/10\/smiling-face-animation-1-300x225.png 300w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/10\/smiling-face-animation-1-74x55.png 74w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/10\/smiling-face-animation-1-111x83.png 111w, https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/10\/smiling-face-animation-1-215x161.png 215w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><figcaption id=\"caption-attachment-31344\" class=\"wp-caption-text\">smiling-face-animation<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>C smiling face animation &#8211;  c programming &#8211; This animation using c draws a smiling face which appears at random position on screen. <\/p>\n","protected":false},"author":2,"featured_media":31338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82927,1],"tags":[83215,83213,83214,85573,83211,83212,83216,79961,83217,83221,83104,83219,83220,83218,83222,83224,83223],"class_list":["post-24852","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming-2","category-coding","tag-animated-cartoon-using-computer-graphics-in-c","tag-animation-program-in-c-with-source-code","tag-c-graphics-program-examples","tag-c-graphics-program-for-smiley-face","tag-c-program-to-print-smiley-face","tag-c-code-for-smiley-face","tag-c-output-smiley-face","tag-computer-graphics-animation-programs-in-c-language-with-output","tag-free-smiling-face","tag-happy-smiling-faces","tag-program-to-draw-a-human-face-in-c-graphics","tag-smiling-face-baby","tag-smiling-face-girl","tag-smiling-face-images","tag-smiling-faces-clip-art","tag-smiling-faces-kevin-gates","tag-smiling-faces-sometimes-youtube"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24852","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=24852"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24852\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media\/31338"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=24852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=24852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=24852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}