Caution: This version of this document is no longer maintained. For the latest documentation, see

PgDrawBevelBox(), PgDrawIBevelBox(), PgDrawBevelBoxCx(), PgDrawIBevelBoxCx()

Draw a beveled box


int  PgDrawBevelBox( PhRect_t const *rect,
                     PgColor_t secondary,
                     short width,
                     int flags );

int  PgDrawIBevelBox( int x1, int y1,
                      int x2, int y2,
                      PgColor_t secondary,
                      short width,
                      int flags );

int  PgDrawBevelBoxCx( void *dc,
                       PhRect_t const *rect,
                       PgColor_t secondary,
                       short width,
                       int flags );

int  PgDrawIBevelBoxCx( void *dc,
                        int x1, int y1,
                        int x2, int y2,
                        PgColor_t secondary,
                        short width,
                        int flags );


PgDrawBevelBoxCx() and PgDrawIBevelBoxCx() only. A void pointer to any type of draw context. Examples of draw contexts are:
rect (PgDrawBevelBox() and PgDrawBevelBoxCx() only)
A rectangle that describes the size of the bevel box.
x1, x2, y1, y2 (PgDrawIBevelBox() and PgDrawIBevelBoxCx() only)
The coordinates of the top left (x1, y1) and bottom right (x2, y2) of the bevel box.
The color of the lower and right edges of the bevel box. The top and left edges are drawn with the current stroke color.
The thickness of the lines.
One of the following:

The flags argument must be one of the following:




These functions build a command in the draw buffer to draw a beveled box. This box is used for the outlines of buttons and panes. PgDrawBevelBox() and PgDrawIBevelBox() work on the current draw context, while you can specify the draw context for PgDrawBevelBoxCx() and PgDrawIBevelBoxCx().

Note: For PgDrawBevelBox() and PgDrawBevelBoxCx(), the width parameter must be ≤ 15.

When you increase the thickness, the lines grow toward the middle of the beveled box. The maximum width is given by Pg_BEVEL_MAX.

Note: PgDrawBevelBox() and PgDrawBevelBoxCx() require a pointer to a PhRect_t structure, whereas PgDrawIBevelBox() and PgDrawIBevelBoxCx() take individual arguments.


The draw buffer is too small to hold the current draw state and the draw command.


The following example:

DrawBevelBox() {
    PhRect_t r = { 8, 8, 152, 112 };
    PgSetFillColor( Pg_GREY );
    PgSetStrokeColor( Pg_WHITE );
    PgDrawBevelBox( &r, Pg_DGREY, 4,
                    Pg_DRAW_FILL_STROKE );

will draw:




Interrupt handler No
Signal handler No
Thread No

See also:

PgColor_t, PgDrawBeveled*(), PgDrawRect*(), PgSetFillColor*(), PgSetFillDither*(), PgSetFillTransPat*(), PgSetStrokeColor*(), PgSetStrokeDither*(), PgSetStrokeTransPat*(), PhRect_t

Arcs, ellipses, polygons, and rectangles in the Raw Drawing and Animation chapter of the Photon Programmer's Guide