XSetDashes()XSetDashes()NameXSetDashes – set a pattern of line dashes in a graphics context.
Synopsis
XSetDashes(display, gc, dash_offset, dash_list, n)
Display *display;
GC gc;
int dash_offset;
char dash_list[];
int n;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
gc Specifies the graphics context.
dash_offset
Specifies the phase of the pattern for the dashed line style.
dash_list Specifies the dash list for the dashed line style. An odd-
length list is equivalent to the same list concatenated with
itself to produce an even-length list.
n Specifies the length of the dash list argument.
DescriptionXSetDashes() sets the dashes component of a GC. The initial and alter‐
nating elements of the dash_list argument are the dashes, the others
are the gaps. All of the elements must be non-zero, with lengths mea‐
sured in pixels. The dash_offset argument defines the phase of the
pattern, specifying how many pixels into the dash_list the pattern
should actually begin in the line drawn by the request.
n specifies the length of dash_list. An odd value for n is interpreted
as specifying the dash_list concatenated with itself to produce twice
as long a list.
Ideally, a dash length is measured along the slope of the line, but
server implementors are only required to match this ideal for horizon‐
tal and vertical lines. Failing the ideal semantics, it is suggested
that the length be measured along the major axis of the line. The
major axis is defined as the x axis for lines drawn at an angle of
between -45 and +45 degrees or between 315 and 225 degrees from the x
axis. For all other lines, the major axis is the y axis.
See Volume One, Chapter 5, The Graphics Context, for further informa‐
tion.
Errors
BadAlloc
BadGC
BadValue No values in dash_list.
Element in dash_list is 0.
See AlsoXDefaultGC(), XChangeGC(), XCopyGC(), XCreateGC(), XFreeGC(), XGCon‐
textFromGC(), XSetArcMode(), XSetBackground(), XSetClipMask(), XSetCli‐
pOrigin(), XSetClipRectangles(), XSetFillRule(), XSetFillStyle(), XSet‐
Foreground(), XSetFunction(), XSetGraphicsExposures(), XSetLineAt‐
tributes(), XSetPlaneMask(), XSetState(), XSetStipple(), XSetSubwindow‐
Mode(), XSetTSOrigin().
Xlib - Graphics Context XSetDashes()