This document describes a C program for a screensaver that simulates a fish pond. It includes the problem statement, design and functions used to create the graphics like ellipses, arcs, circles, lines, and floodfill. Functions like ellipse, circle, line, floodfill and kbhit are used to draw the background, ground, and three fish. The program animates the fish moving across the screen at intervals to create the screensaver effect.
This document describes a C program for a screensaver that simulates a fish pond. It includes the problem statement, design and functions used to create the graphics like ellipses, arcs, circles, lines, and floodfill. Functions like ellipse, circle, line, floodfill and kbhit are used to draw the background, ground, and three fish. The program animates the fish moving across the screen at intervals to create the screensaver effect.
This document describes a C program for a screensaver that simulates a fish pond. It includes the problem statement, design and functions used to create the graphics like ellipses, arcs, circles, lines, and floodfill. Functions like ellipse, circle, line, floodfill and kbhit are used to draw the background, ground, and three fish. The program animates the fish moving across the screen at intervals to create the screensaver effect.
SUBMITTED TO: MR. ARUN MALIK PROBLEM STATEMENT: PROBLEM STATEMENT: PROBLEM STATEMENT: PROBLEM STATEMENT: D DD DESIGN A SCREENSAVER OF FISH POND USING C ESIGN A SCREENSAVER OF FISH POND USING C ESIGN A SCREENSAVER OF FISH POND USING C ESIGN A SCREENSAVER OF FISH POND USING C
Design function: Design function: Design function: Design function: The program has been created using various functions such as ellipse, fillellipse, arc, circle, line and bar. Floodfill has been used to fill the color in the fish. The background color has been set using setbkcolor function. The fish has been made using 4 arcs, two lines and a circle for eye. The ground has been made using 3 fillellipse function and a bar. For the plant I have used ellipse function.
Functions used: Functions used: Functions used: Functions used: Ellipse: ellipse draws an elliptical arc fillellipse draws and fills an ellipse sector draws and fills an elliptical pie slice Declaration: void far ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius); void far fillellipse(int x, int y, int xradius, int yradius); void far sector(int x, int y, int stangle, int endangle, int xradius, int yradius);
Arc: arc draws a circular arc circle draws a circle pieslice draws and fills a circular pie slice Declaration: void far arc(int x, int y, int stangle, int endangle, int radius); void far circle(int x, int y, int radius); void far pieslice(int x, int y, int stangle, int endangle, int radius); Line: line draws a line between two specified points linerel draws a line a relative distance from the current position (CP) lineto draws a line from the current position (CP) to (x,y). Declaration: void far line(int x1, int y1, int x2, int y2); void far linerel(int dx, int dy); void far lineto(int x, int y); Circle: arc draws a circular arc circle draws a circle pieslice draws and fills a circular pie slice. Declaration: void far arc(int x, int y, int stangle, int endangle, int radius); void far circle(int x, int y, int radius); void far pieslice(int x, int y, int stangle, int endangle, int radius);
KBHIT: Checks for currently available keystrokes Declaration: int kbhit(void); Remarks: kbhit checks to see if a keystroke is currently available. Any available keystrokes can be retrieved with getch or getche.
Return Value: On success (if a keystroke is available), returns a non-zero integer If a keystroke is not available, returns 0. Floodfill: Flood-fills a bounded region Declaration: void far floodfill(int x, int y, int border); Remarks: floodfill fills an enclosed area on bitmap devices. The area bounded by the color border is flooded with the current fill pattern and fill color. (x,y) is a "seed point". If the seed is within an enclosed area, the inside will be filled. If the seed is outside the enclosed area, the exterior will be filled.
Program and Output Screenshot: Program and Output Screenshot: Program and Output Screenshot: Program and Output Screenshot: Program and Output Screenshot: Program and Output Screenshot: Program and Output Screenshot: Program and Output Screenshot: