主页 / 库函数目录 / 图形绘制 / bar3d

功能:

绘制有边框的三维填充矩形。其中,填充颜色由 setfillcolor() 函数指定

声明:
void bar3d(
    int left,
    int top,
    int right,
    int bottom,
    int depth,
    bool topflag,
    PIMAGE pimg = NULL
);
参数: left 矩形左部 x 坐标。 top 矩形上部 y 坐标。 right 矩形右部 x 坐标(该点取不到,实际右边界为right-1)。 bottom 矩形下部 y 坐标(该点取不到,实际下边界为bottom-1)。 depth 矩形深度。 topflag 为 false 时,将不画矩形的三维顶部。该选项可用来画堆叠的三维矩形。 pimg 绘制的目标图像,默认为 NULL(即绘制到窗口)。 返回值: (无) 示例:
#include <graphics.h>

int main()
{
    initgraph(600, 400);
    setfillstyle(RED);
    bar3d(100, 100, 150, 150, 20, 1);
    getch();
    return 0;
}
示例效果: