XFillPolygon()XFillPolygon()NameXFillPolygon – fill a polygon.
Synopsis
XFillPolygon(display, drawable, gc, points, npoints, shape, mode)
Display *display;
Drawable drawable;
GC gc;
XPoint *points;
int npoints;
int shape;
int mode;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
drawable Specifies the drawable.
gc Specifies the graphics context.
points Specifies a pointer to an array of points.
npoints Specifies the number of points in the array.
shape Specifies an argument that helps the server to improve per‐
formance. Pass the last constant in this list that is valid
for the polygon to be filled: Complex, Nonconvex, or Convex.
mode Specifies the coordinate mode. Pass either CoordModeOrigin
or CoordModePrevious.
DescriptionXFillPolygon() fills the region closed by the specified path. Some but
not all of the path itself will be drawn. The path is closed automati‐
cally if the last point in the list does not coincide with the first
point. No pixel of the region is drawn more than once.
The mode argument affects the interpretation of the points that define
the polygon:
· CoordModeOrigin indicates that all points are relative to the draw‐
able's origin.
· CoordModePrevious indicates that all points after the first are rel‐
ative to the previous point. (The first point is always relative to
the drawable's origin.)
The shape argument allows the fill routine to optimize its performance
given tips on the configuration of the area.
· Complex indicates the path may self-intersect. The fill_rule of the
GC must be consulted to determine which areas are filled. See Vol‐
ume One, Chapter 5, The Graphics Context, for a discussion of the
fill rules EvenOddRule and WindingRule.
· Nonconvex indicates the path does not self-intersect, but the shape
is not wholly convex. If known by the client, specifying Nonconvex
instead of Complex may improve performance. If you specify Noncon‐
vex for a self-intersecting path, the graphics results are unde‐
fined.
· Convex means that for every pair of points inside the polygon, the
line segment connecting them does not intersect the path. Convex
can improve performance even more than Nonconvex, but if the path is
not convex, the graphics results are undefined.
Contiguous coincident points in the path are not treated as self-inter‐
section.
XFillPolygon() uses these graphics context components when filling the
polygon area: function, plane_mask, fill_style, fill_rule, subwin‐
dow_mode, clip_ x_origin, clip_y_origin, and clip_mask. This function
also uses these mode-dependent components of the GC: foreground, back‐
ground, tile, stipple, ts_x_
origin, and ts_y_origin.
For more information, see Volume One, Chapter 6, Drawing Graphics and
Text, and Chapter 5, The Graphics Context.
Structures
typedef struct {
short x, y;
} XPoint;
Errors
BadDrawable
BadGC
BadMatch
BadValue
See AlsoXClearArea(), XClearWindow(), XCopyArea(), XCopyPlane(), XDraw,
XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(), XDrawLines(),
XDrawPoint(), XDrawPoints(), XDrawRectangle(), XDrawRectangles(),
XDrawSegments(), XFillArc(), XFillArcs(), XFillRectangle(), XFillRect‐
angles().
Xlib - Drawing Primitives XFillPolygon()