Draw a beveled rectangle or arrow
int PgDrawBeveled( PhRect_t const *rect, PhPoint_t const *radii, PgColor_t secondary, short width, int flags );
This function builds a command in the draw buffer to draw a beveled rectangle or arrow. The rect parameter defines the area that the object will fill. The flags parameter defines how the object will be drawn, and includes options for defining the types of corners that it will have.
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 width argument determines the thickness of the lines. When you increase the thickness, the lines grow toward the middle of the beveled object.
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 |
PgDrawBevelBox(), PgDrawRect(), PgDrawIRect(), PgDrawRoundRect(), PgSetFillColor(), PgSetFillDither(), PgSetFillTransPat(), PgSetStrokeColor(), PgSetStrokeDither(), PgSetStrokeTransPat()