Draw a beveled rectangle or arrow
int PgDrawBeveled( PhRect_t const *rect, PhPoint_t const *radii, PgColor_t secondary, short width, int flags ); int PgDrawBeveledCx( void *dc; PhRect_t const *rect, PhPoint_t const *radii, PgColor_t secondary, short width, int flags );
ph
These functions build a command in the draw buffer to draw a beveled rectangle or arrow. The flags parameter defines how the object is drawn, and includes options for defining the types of corners that it has. PgDrawBeveled() works on the current draw context, while you can specify the draw context for PgDrawBeveledCx().
The upper and left edges of the object are drawn in the current stroke color; the lower and right edges are drawn in the secondary color.
The flags argument must be one of the following:
You can OR the flags argument with one of the following:
You can also OR the flags argument with the following:
The following example:
DrawBeveled() { PhRect_t rc = { 8, 8, 152, 56 }; PhRect_t rr = { 8, 64, 152, 112 }; PhPoint_t pc = { 8, 8 }; PhPoint_t pr = { 12, 12 }; PgSetFillColor( Pg_GREY ); PgSetStrokeColor( Pg_WHITE ); PgDrawBeveled( &rc, &pc, Pg_DGREY, 2, Pg_DRAW_FILL_STROKE | Pg_BEVEL_CLIP ); PgDrawBeveled( &rr, &pr, Pg_DGREY, 2, Pg_DRAW_FILL_STROKE | Pg_BEVEL_ROUND ); }
will draw:
The following example:
DrawBevelArrow() { PhRect_t rup = { 20, 4, 44, 16 }; PhRect_t rdown = { 20, 48, 44, 60 }; PhRect_t rleft = { 4, 20, 16, 44 }; PhRect_t rright = { 48, 20, 60, 44 }; PgSetFillColor( Pg_GREY ); PgSetStrokeColor( Pg_WHITE ); PgDrawBeveled( &rup, NULL, Pg_DGREY, 1, Pg_DRAW_FILL_STROKE | Pg_BEVEL_AUP ); PgDrawBeveled( &rdown, NULL, Pg_DGREY, 1, Pg_DRAW_FILL_STROKE | Pg_BEVEL_ADOWN ); PgDrawBeveled( &rleft, NULL, Pg_DGREY, 1, Pg_DRAW_FILL_STROKE | Pg_BEVEL_ALEFT ); PgDrawBeveled( &rright, NULL, Pg_DGREY, 1, Pg_DRAW_FILL_STROKE | Pg_BEVEL_ARIGHT ); }
will draw:
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PgColor_t, PgDrawArrow*(), PgDrawBevelBox*(), PgDrawRect*(), PgDrawIRect*(), PgDrawRoundRect*(), PgSetFillColor*(), PgSetFillDither*(), PgSetFillTransPat*(), PgSetStrokeColor*(), PgSetStrokeDither*(), PgSetStrokeTransPat*(), PhPoint_t, PhRect_t
“Arcs, ellipses, polygons, and rectangles” in the Raw Drawing and Animation chapter of the Photon Programmer's Guide