Program to creating Doraemon cartoon character using Computer Graphics
Computer Graphics is an important subject to improve coding skills. Many things can be implemented using computer graphics. For example- car animation, cartoon characters, and many more things. In this article, the cartoon character Doraemon is created using computer graphics.
Implementation in C
In C, the graphics.h functions are used to draw different shapes(like a circle, rectangle, etc), display text(any message) in different formats (different fonts and colors). By using graphics.h it is possible to make programs, animations and also games. These can be useful for beginners.
- setcolor(n): A function from graphics.h header file which sets the color of the pointer(cursor).
- line(int x1, int y1, int x2, int y2): Line function is used to draw a line from a point(x1, y1) to a point(x2, y2) i.e. (x1, y1) and (x2, y2) are endpoints of the line.The code given below draws a line.
- setfillstyle(pattern, color): The header file graphics.h contains setfillstyle() function which sets the current fill pattern and fills color.
- floodfill(pattern, color): function is used to fill an enclosed area. The current fill pattern and fill color are used to fill the area.
Below is the implementation of drawing the cartoon character Doraemon using graphics in C: