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 );
The flags argument must be one of the following:
ph
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().
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.
PgDrawBevelBox() and PgDrawBevelBoxCx() require a pointer to a PhRect_t structure, whereas PgDrawIBevelBox() and PgDrawIBevelBoxCx() take individual arguments. |
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:
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
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