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/gf/dev_guide/api/gf_context_set_polyfill.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/gf/dev_guide/api/gf_context_set_polyfill.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/gf/dev_guide/api/gf_context_set_polyfill.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/gf/dev_guide/api/gf_context_set_polyfill.html on line 8

gf_context_set_polyfill()

Set the polygon fill rule

Synopsis:

#include <gf/gf.h>

void gf_context_set_polyfill( gf_context_t context,
                              int polyfill );

Arguments:

context
The draw context to set the polygon fill rule for.
polyfill
The winding rule for the polygon fill. Can be one of:

Library:

gf

Description:

This function replaces the polygon fill rule for the specified draw context. The polygon fill rule determines how the fill for polygons is rendered. If you're only drawing simple, convex polygons, you can optimize rendering speed by setting the fill rule to GF_CONTEXT_POLYFILL_CONVEX.

By default, polygons that overlap themselves are filled using the so-called even-odd rule (GF_CONTEXT_POLYFILL_EVENODD): if an area overlaps an odd number of times, it isn't filled. Another way of looking at this is to draw a horizontal line across the polygon. As you travel along this line and cross the first line, you're inside the polygon; as you cross the second line, you're outside. As an example, consider a simple polygon:


Simple polygon


Filling a simple polygon.

This rule can be extended for more complicated polygons:


Overlapping polygon


Filling an overlapping polygon.

If you want a polygon that overlaps itself to be completely filled in all regions within its boundary, you can set the fill rule to GF_CONTEXT_POLYFILL_NONZERO.

Classification:

QNX Graphics Framework

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

gf_context_set_linejoin(), gf_draw_poly_fill()

Drawing lines and polygons in the Basic Drawing chapter


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/gf/dev_guide/api/gf_context_set_polyfill.html on line 151

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/gf/dev_guide/api/gf_context_set_polyfill.html on line 151