Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

C++ bar3d() - Draw a 3D bar on the Screen

In C++, bar3d() function is used to draw a three dimensional bar (3D) between two given points on the screen. This function is quite similar to bar() function (that is used to draw simple bar), but it draws 3D bar.

Syntax of bar3d()

The general syntax of this function is looks like:

bar3d (left, top, right, bottom, depth, flag);
Where:
left and top represents the x & y co-ordinates of the first point. The "left" indicates x-coordinate of the first point and the "top" indicates the y-coordinate of the first point.
right and bottom represents the x & y co-ordinates of the second point. The "right" indicates x-coordinate of the second point and the "bottom" indicates the y-coordinate of the second point.
depth It represents the depth of bar in pixels.
flag It represents the flag put on the top of bar. It it's value is zero then no flag is put.

Example of bar3d() Function


#include
#include
#include
using namespace std;
main()
{
int driver, mode;
driver = DETECT;
initgraph (&driver, &m, " ");
cleardevice();
bar3d ( 200, 100, 300, 600, 15, 2);
getch();
closegraph();
}


This post first appeared on Programming Explain, please read the originial post: here

Share the post

C++ bar3d() - Draw a 3D bar on the Screen

×

Subscribe to Programming Explain

Get updates delivered right to your inbox!

Thank you for your subscription

×