bar3d

Overview :

The "bar3d" function is used to draw a three-dimensional rectangle with the current fill pattern in graphics mode.

Syntax :
void bar3d(int left, int top, int right, int bottom,int depth,int topflag);
Description :

The "bar3d" function accepts 6 parameters

  • left -> The x co-ordinate of the upper left point of rectangle

  • top -> The y co-ordinate of the upper left point of rectangle

  • right -> The x co-ordinate of the lower right point of rectangle

  • bottom -> The y co-ordinate of the lower right point of rectangle

  • depth -> It indicate the bar depth in pixels

  • topflag -> It indicate whether the top portion of rectangle is to be shown or not.If topflag = 0,then the top is not placed ,else it ie placed

  • By default the fill pattern is "SOLID" you can fill style by using setfillstyle

"bar3d" function does not return any value.

Example :
int main()
{

   int gm,gd=DETECT,maxcolor;

   initgraph(&gd,&gm,"C:\\turboc3\\bgi");
   setcolor(10);
   
   outtextxy(100,60,"Rectangle with no top");
   setfillstyle(LINE_FILL,4);
   bar3d(100,100,200,200,20,0);
   
   outtextxy(300,250,"Rectangle with top");
   setfillstyle(SLASH_FILL,6);
   bar3d(300,300,400,400,20,1);

   getch();
   closegraph();
   return 0;
}


Comments

comments powered by Disqus