Set the fill color for XOR drawing
void PgSetFillXORColor( PgColor_t frgd,
PgColor_t bkgd );
This function sets the draw color for fills. When an application XORs this color with the color bkgd, the result is the color frgd.
Since XOR is a reflexive function, frgd and bkgd may be reversed.
The following example:
DrawXOR() {
char *s = "Hello World!";
PhPoint_t p = { 8, 30 };
PhRect_t r;
PgSetFont( "helv18" );
PgSetTextColor( Pg_YELLOW );
PgSetFillColor( Pg_PURPLE );
PgDrawText( s, strlen( s ), &p, Pg_BACK_FILL );
PgExtentText( &r, &p, "helv18", s, strlen( s ) );
r.lr.x -= (r.lr.x - r.ul.x) / 2;
PgSetDrawMode( Pg_DRAWMODE_XOR );
PgSetFillXORColor( Pg_YELLOW, Pg_PURPLE );
PgDrawRect( &r, Pg_DRAW_FILL );
PgSetDrawMode( Pg_DRAWMODE_OPAQUE );
}
will draw:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
PgSetDrawMode(), PgSetFillColor(), PgSetFillDither(), PgSetStrokeColor(), PgSetStrokeDither(), PgSetStrokeXORColor(), PgSetTextColor(), PgSetTextDither(), PgSetTextXORColor()