Company-Wide Library. ShapeChef enables you to create shared libraries that are accessible to an entire team or company. Using this feature, you can build a central repository for graphics and charts commonly used in your organization. 26000+ Icons & Illustrations to SVG, Lottie, React. Shape lets you customize the style, colors and border of static & animated icons and illustrations. You can export to React, SVG and Lottie code.
Page Stats
Visitor: 1174
Using C, C++ Graphics, we can create basic shapes like line, circle, rectangle, ellipse, arc, bar, bar3d, and display text. To use graphics functions, we must include graphics.h header file.
Line Function
Line function is used to draw a straight line, there are 4 parameters used in line function (x1,y1,x2,y2).
Example 1: Line function in C - Graphics. 172
Code Explanation:
- graphics.h header file is must in all the programs, if you are using graphics functions.
- initgraph is used to initialize the system graphics by loading a graphics driver from disk and thereby putting the system into graphics mode. initgraph takes 3 parameters: graphic detect, graphic mode, and bgi file path.
- bgi stands for Borland Graphics Interface, it is a graphic library. This library loads graphic drivers and vector fonts (*.CHR).
- closegraph deallocates the memory allocated by the system graphics and then restores the screen to the mode it was before calling initgraph.
Circle Function
Circle function is used to draw a circle which required 3 parameters i.e x, y and radius.
Example 2: WAP to draw a circle with radius of 80 pixels. 185
Example 3: WAP to draw a circle with radius of 80 pixels on the center of screen.
- getmaxx It returns the maximum X coordinate
- getmaxy It returns the maximum Y coordinate
Rectangle Function
Rectangle function is used to draw a rectangle which required 4 parameters i.e x1(left), y1(top), x2(right) and y2(bottom).
Example 4: Rectangle function in C - Graphics. 179
Ellipse Function
Ellipse function is used to draw a ellipse. Syntax: ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius);
Example 5: Ellipse function in C - Graphics. 112
Arc Function
Arc function is used to draw a arc. Syntax: arc(int x, int y, int stangle, int endangle, int radius);
Example 6: Arc function in C - Graphics. 171
Bar Function
Bar function draws a rectangle and fill it with current fill pattern and color. Syntax: bar(int left, int top, int right, int bottom);
Example 7: Bar function in C - Graphics. 177
Bar3d Function
Bar3d function is used to draw a 2-dimensional rectangular filled in bar. Syntax:
Example 8: Bar3d function in C - Graphics. 118
Graphic Shape Library For Kids
Example 9: outtextxy function in C - Graphics. 106
Color functions in C Graphics
In C Graphics, there are 16 colors declared. We use colors to set background color, change color of shapes, fill color of shapes, change text color.
- textcolor is use to set the text color.
- setbkcolor is use to set the background color by specifying the color name or the number
- setcolor is use to set the text color or set the outline color of the various shapes.
Graphic Shape Library For Photoshop
S.No. | Color Name | Color Value |
---|---|---|
BLACK | 0 | |
BLUE | 1 | |
GREEN | 2 | |
CYAN | 3 | |
RED | 4 | |
MAGENTA | 5 | |
BROWN | 6 | |
LIGHTGRAY | 7 | |
DARKGRAY | 8 | |
LIGHTBLUE | 9 | |
LIGHTGREEN | 10 | |
LIGHTCYAN | 11 | |
LIGHTRED | 12 | |
LIGHTMAGENTA | 13 | |
YELLOW | 14 | |
WHITE | 15 |