XDrawRectangles()XDrawRectangles()Name
XDrawRectangles – draw the outlines of multiple rectangles.
Synopsis
XDrawRectangles(display, drawable, gc, rectangles, nrectangles)
Display *display;
Drawable drawable;
GC gc;
XRectangle rectangles[];
int nrectangles;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
drawable Specifies the drawable.
gc Specifies the graphics context.
rectangles
Specifies a pointer to an array of rectangles containing
position and size information.
nrectangles
Specifies the number of rectangles in the array.
DescriptionXDrawRectangles() draws the outlines of the specified rectangles by
using the position and size values in the array of rectangles. The x
and y coordinates of each rectangle are relative to the drawable's ori‐
gin, and define the upper-left corner of the rectangle.
The rectangles are drawn in the order listed. For any given rectangle,
no pixel is drawn more than once. If rectangles intersect, pixels are
drawn multiple times.
In R4 and earlier there is a limit to the number of rectangles that can
be drawn in a single XDrawRectangles() call, based on the maximum
request size, which varies according to the server. In R5, Xlib chops
your call into as many protocol requests as required. To determine how
many rectangles you can draw in a single call in R4, find out your
server's maximum request size using XMaxRequestSize(). Subtract three
and divide by two. This is the maximum number of rectangles you can
draw in a single XDrawRectangles() call.
This function uses these graphics context components: function,
plane_mask, line_width, line_style, join_style, fill_style, subwin‐
dow_mode, clip_x_origin, clip_y_origin, and clip_mask. XDrawRectan‐
gles() also uses these graphics context mode-dependent components:
foreground, background, tile, stipple, ts_x_origin, ts_y_origin,
dash_offset, and dashes.
For more information, see Volume One, Chapter 6, Drawing Graphics and
Text, and Chapter 5, The Graphics Context.
Structures
typedef struct {
short x, y;
unsigned short width, height;
} XRectangle;
Errors
BadDrawable
BadGC
BadMatch
See AlsoXClearArea(), XClearWindow(), XCopyArea(), XCopyPlane(), XDraw,
XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(), XDrawLines(),
XDrawPoint(), XDrawPoints(), XDrawRectangle(), XDrawSegments(), XFil‐
lArc(), XFillArcs(), XFillPolygon(), XFillRectangle(), XFillRectan‐
gles().
Xlib - Drawing Primitives XDrawRectangles()