XDrawLine(display, d, gc, x1, y1, x2, y2)
      Display *display;
      Drawable d;
      GC gc;
      int x1, y1, x2, y2;


display Specifies the connection to the X server.
d Specifies the drawable.
gc Specifies the GC.
Specify the points (x1, y1) and (x2, y2) to be connected.


The XDrawLine() function uses the components of the specified GC to draw a line between the specified set of points (x1, y1) and (x2, y2). It does not perform joining at coincident endpoints. For any given line, XDrawLine() does not draw a pixel more than once. If lines intersect, the intersecting pixels are drawn multiple times.

XDrawLine() use these GC components: function, plane-mask, line-width, line-style, cap-style, fill-style, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask. XDrawLine() also uses these GC mode-dependent components: foreground, background, tile, stipple, tile-stipple-x-origin, tile-stipple-y-origin, dash-offset, and dash-list.

XDrawLine(), can generate BadDrawable , BadGC , and BadMatch errors.


BadDrawable A value for a Drawable argument does not name a defined Window or Pixmap.
BadGC A value for a GContext argument does not name a defined GContext.
BadMatch An InputOnly window is used as a Drawable.
BadMatch Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.

See also

XDrawArc(), XDrawLines(), XDrawPoint(), XDrawRectangle(), XDrawSegments(), "Drawing Single and Multiple Lines".
Christophe Tronche, [email protected]