XSetFillRule() XSetFillRule()
Name
XSetFillRule - set the fill rule in a graphics context.
Synopsis
XSetFillRule(display, gc, fill_rule)
Display *display;
GC gc;
int fill_rule;
Arguments
display Specifies a connection to an X server; returned from XOpenDisplay().
gc Specifies the graphics context.
fill_rule Specifies the fill rule you want to set for the specified graphics context. Possible values are EvenOddRule or WindingRule.
Description
XSetFillRule() sets the fill_rule component of a GC. The fill_rule member of the GC determines what pixels are drawn in XFillPolygon()
requests. Simply put, WindingRule fills overlapping areas of the polygon, while EvenOddRule does not fill areas that overlap an odd number
of times. Technically, EvenOddRule means that the point is drawn if an arbitrary ray drawn from the point would cross the path determined
by the request an odd number of times. WindingRule indicates that a point is drawn if a point crosses an unequal number of clockwise and
counterclockwise path segments, as seen from the point.
A clockwise-directed path segment is one which crosses the ray from left to right as observed from the point. A counterclockwise segment
is one which crosses the ray from right to left as observed from the point. The case where a directed line segment is coincident with the
ray is uninteresting because you can simply choose a different ray that is not coincident with a segment.
All calculations are performed on infinitely small points, so that if any point within a pixel is considered inside, the entire pixel is
drawn. Pixels with centers exactly on boundaries are considered inside only if the filled area is to the right, except that on horizontal
boundaries, the pixel is considered inside only if the filled area is below the pixel.
See Volume One, Chapter 5, The Graphics Context, for more information.
Errors
BadAlloc
BadGC
BadValue
See Also
XDefaultGC(), XChangeGC(), XCopyGC(), XCreateGC(), XFreeGC(), XGContextFromGC(), XSetArcMode(), XSetBackground(), XSetClipMask(), XSetCli-
pOrigin(), XSetClipRectangles(), XSetDashes(), XSetFillStyle(), XSetForeground(), XSetFunction(), XSetGraphicsExposures(), XSetLineAt-
tributes(), XSetPlaneMask(), XSetState(), XSetStipple(), XSetSubwindowMode(), XSetTSOrigin().
Xlib - Graphics Context XSetFillRule()