Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XFillPolygo(3x) — HP-UX ANSI C A.10.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XFillPolygon − 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

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

drawableSpecifies the drawable. 

gcSpecifies the graphics context. 

pointsSpecifies a pointer to an array of points. 

npointsSpecifies the number of points in the array. 

shapeSpecifies an argument that helps the server to improve performance.  Pass the last constant in this list that is valid for the polygon to be filled: Complex, Nonconvex, or Convex. 

modeSpecifies the coordinate mode.  Pass either CoordModeOrigin or CoordModePrevious. 

Description

XFillPolygon() fills the region closed by the specified path.  Some but not all of the path itself will be drawn.  The path is closed automatically 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 drawable’s origin. 

•CoordModePrevious indicates that all points after the first are relative 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 Volume 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 Nonconvex for a self-intersecting path, the graphics results are undefined. 

•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-intersection.  XFillPolygon() uses these graphics context components when filling the polygon area:  function, plane_mask, fill_style, fill_rule, subwindow_mode, clip_ x_origin, clip_y_origin, and clip_mask.  This function also uses these mode-dependent components of the GC: foreground, background, 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 Also

XClearArea(), XClearWindow(), XCopyArea(), XCopyPlane(), XDraw, XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(), XDrawLines(), XDrawPoint(), XDrawPoints(), XDrawRectangle(), XDrawRectangles(), XDrawSegments(), XFillArc(), XFillArcs(), XFillRectangle(), XFillRectangles(). 

Copyright O’Reilly & Assoc.  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026