0% found this document useful (0 votes)
28 views3 pages

Week-1: Prepare The Brief Study of All The Functions of Graphic

The document summarizes the key graphics functions in C graphics: 1) Initgraph initializes the graphics system and resets settings to defaults. 2) Getpixel and Putpixel get and set pixel colors at coordinates. 3) Closegraph shuts down the graphics system and restores the original screen mode.

Uploaded by

Ankita Bajaj
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

Week-1: Prepare The Brief Study of All The Functions of Graphic

The document summarizes the key graphics functions in C graphics: 1) Initgraph initializes the graphics system and resets settings to defaults. 2) Getpixel and Putpixel get and set pixel colors at coordinates. 3) Closegraph shuts down the graphics system and restores the original screen mode.

Uploaded by

Ankita Bajaj
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

WEEK- 1

Prepare the brief study of all the functions of graphic.


1) INITGRAPH- It initializes the graphics system. Void far initgraph (int far *graphdriver) 1. 2. To start the graphic system, you must first call initgraph. Initgraph initializes the graphic system by loading a graphics driver from disk (or validating a registered driver) then putting the system into graphics mode. 3. Initgraph also resets all graphics settings (color, palette, current position, viewport, etc) to their defaults then resets graph.

2) GETPIXEL, PUTPIXEL- Getpixel gets the color of a specified pixel and Putpixel places a pixel at a specified point. Unsigned far getpixel(int x, int y) Void far putpixel(int x, int y, int color) 1. 2. Getpixel gets the color of the pixel located at (x,y). Getpixel returns the color of the given pixel. Putpixel plots a point in the color defined at (x, y). Putpixel does not return.

3) CLOSE GRAPH- Shuts down the graphic system. Void far closegraph(void); 1. 2. Close graph deallocates all memory allocated by the graphic system. It then restores the screen to the mode it was in before you called initgraph.

4) ARC, CIRCLE, PIESLICE- arc draws a circular arc. Circle draws a circle. Pieslice draws and fills a circular pieslice. 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); 1. Arc draws a circular arc in the current drawing color 2. Circle draws a circle in the current drawing color 3. Pieslice draws a pieslice in the current drawing color, then fills it using the current fill pattern and fill color.

5) ELLIPSE, FILLELIPSE, SECTOR- Ellipse draws an elliptical arc. Fillellipse draws and fills ellipse. Sector draws and fills an elliptical pie slice. 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 farsector(int x, int y, int stangle, int endangle, int xradius, int yradius) 1. Ellipse draws an elliptical arc in the current drawing color. 2. 3. Fillellipse draws an elliptical arc in the current drawing color and than fills it with fill color and fill pattern. Sector draws an elliptical pie slice in the current drawing color and than fills it using the pattern and color defined by setfillstyle or setfillpattern.

6) FLOODFILL- Flood-fills a bounded region. Void far floodfill(int x, int y, int border) 1. Floodfills an enclosed area on bitmap device. 2. The area bounded by the color border is flooded with the current fill pattern and fill color.

7) GETCOLOR, SETCOLOR- Getcolor returns the current drawing color. Setcolor returns the current drawing color. Int far getcolor(void); Void far setcolor(int color)

8) LINE, LINEREL, LINETO- Line draws a line between two specified pints. Onerel draws a line relative distance from current position(CP). Linrto draws a line from the current position (CP) to(x,y). Void far lineto(int x, int y) 1. Line draws a line from (x1, y1) to (x2, y2) using the current color, line style and thickness. It does not update the current position (CP). 2. 3. Linerel draws a line from the CP to a point that is relative distance (dx, dy) from the CP, then advances the CP by (dx, dy). Lineto draws a line from the CP to (x, y), then moves the CP to (x,y).

9) RECTANGLE- Draws a rectangle in graphics mode. Void far rectangle(int left, int top, int right, int bottom) 1. 2. It draws a rectangle in the current line style, thickness and drawing color. (left, top) is the upper left corner of the rectangle, and (right, bottom) is its lower right corner.

You might also like