Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgsetfillxorcolor.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgsetfillxorcolor.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgsetfillxorcolor.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgsetfillxorcolor.html on line 8

PgSetFillXORColor(), PgSetFillXORColorCx()

Set the fill color for XOR drawing

Synopsis:

void PgSetFillXORColor( PgColor_t frgd,
                        PgColor_t bkgd );

void PgSetFillXORColorCx( PhGC_t *gc,
                          PgColor_t frgd,
                          PgColor_t bkgd );

Library:

ph

Description:

These functions set 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.

PgSetFillXORColor() works on the current graphics context, while you can specify the graphics context gc for PgSetFillXORColorCx().

Examples:

DrawXOR() {
    char *s = "Hello World!";
    PhPoint_t p = { 8, 30 };
    PhRect_t    r;
    char Helvetica18[MAX_FONT_TAG];

    if(PfGenerateFontName("Helvetica", 0, 18,
                          Helvetica18) == NULL) {
        perror ("Unable to find font");
    } else {
        PgSetFont( Helvetica18 );
        PgSetTextColor( Pg_YELLOW );
        PgSetFillColor( Pg_PURPLE );
        PgDrawText( s, strlen( s ), &p, Pg_BACK_FILL );

        PgExtentText( &r, &p, Helvetica18, 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 );
    }
}

The above code draws:

PgSetFillXORColor

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgColor_t, PgDefaultFill*(), PgSetDrawMode*(), PgSetFillColor*(), PgSetFillDither*(), PgSetFillTransPat*(), PgSetStrokeXORColor*(), PgSetTextXORColor*()

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


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgsetfillxorcolor.html on line 147

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgsetfillxorcolor.html on line 147