1XDrawArc(3)                     XLIB FUNCTIONS                     XDrawArc(3)
2
3
4

NAME

6       XDrawArc, XDrawArcs, XArc - draw arcs and arc structure
7

SYNTAX

9       int XDrawArc(Display *display, Drawable d, GC gc, int x, int y,
10              unsigned int width, unsigned int height, int angle1, int
11              angle2);
12
13       int XDrawArcs(Display *display, Drawable d, GC gc, XArc *arcs, int
14              narcs);
15

ARGUMENTS

17       angle1    Specifies the start of the arc relative to the three-o'clock
18                 position from the center, in units of degrees * 64.
19
20       angle2    Specifies the path and extent of the arc relative to the
21                 start of the arc, in units of degrees * 64.
22
23       arcs      Specifies an array of arcs.
24
25       d         Specifies the drawable.
26
27       display   Specifies the connection to the X server.
28
29       gc        Specifies the GC.
30
31       narcs     Specifies the number of arcs in the array.
32
33       width
34       height    Specify the width and height, which are the major and minor
35                 axes of the arc.
36
37
38       x
39       y         Specify the x and y coordinates, which are relative to the
40                 origin of the drawable and specify the upper-left corner of
41                 the bounding rectangle.
42

DESCRIPTION

44       XDrawArc draws a single circular or elliptical arc, and XDrawArcs draws
45       multiple circular or elliptical arcs.  Each arc is specified by a rec‐
46       tangle and two angles.  The center of the circle or ellipse is the cen‐
47       ter of the rectangle, and the major and minor axes are specified by the
48       width and height.  Positive angles indicate counterclockwise motion,
49       and negative angles indicate clockwise motion.  If the magnitude of
50       angle2 is greater than 360 degrees, XDrawArc or XDrawArcs truncates it
51       to 360 degrees.
52
53       For an arc specified as [x,y,width,height,angle1,angle2], the origin of
54       the major and minor axes is at [x+w_i_d2_t_h_,y+h_e_i_g2_h_t_], and the infinitely
55       thin path describing the entire circle or ellipse intersects the hori‐
56       zontal axis at [x,y+h_e_i_g2_h_t_] and [x+width,y+h_e_i_g2_h_t_] and intersects the
57       vertical axis at [x+w_i_d2_t_h_,y] and [x+w_i_d2_t_h_,y+height].  These coordinates
58       can be fractional and so are not truncated to discrete coordinates.
59       The path should be defined by the ideal mathematical path.  For a wide
60       line with line-width lw, the bounding outlines for filling are given by
61       the two infinitely thin paths consisting of all points whose perpendic‐
62       ular distance from the path of the circle/ellipse is equal to lw/2
63       (which may be a fractional value).  The cap-style and join-style are
64       applied the same as for a line corresponding to the tangent of the cir‐
65       cle/ellipse at the endpoint.
66
67       For an arc specified as [x,y,width,height,angle1,angle2], the angles
68       must be specified in the effectively skewed coordinate system of the
69       ellipse (for a circle, the angles and coordinate systems are identi‐
70       cal).  The relationship between these angles and angles expressed in
71       the normal coordinate system of the screen (as measured with a protrac‐
72       tor) is as follows:
73
74       skewed-angle=atan⎛⎝tan(normal-angle)*h_we_ii_dg_th_ht_⎞⎠+adjust
75
76       The skewed-angle and normal-angle are expressed in radians (rather than
77       in degrees scaled by 64) in the range [0,2π] and where atan returns a
78       value in the range [−π2_,π2_] and adjust is:
79
80       l l.  0    for normal-angle in the range [0,π2_] π    for normal-angle in
81       the range [π2_,3_π2_] 2π   for normal-angle in the range [3_π2_,2π]
82
83       For any given arc, XDrawArc and XDrawArcs do not draw a pixel more than
84       once.  If two arcs join correctly and if the line-width is greater than
85       zero and the arcs intersect, XDrawArc and XDrawArcs do not draw a pixel
86       more than once.  Otherwise, the intersecting pixels of intersecting
87       arcs are drawn multiple times.  Specifying an arc with one endpoint and
88       a clockwise extent draws the same pixels as specifying the other end‐
89       point and an equivalent counterclockwise extent, except as it affects
90       joins.
91
92       If the last point in one arc coincides with the first point in the fol‐
93       lowing arc, the two arcs will join correctly.  If the first point in
94       the first arc coincides with the last point in the last arc, the two
95       arcs will join correctly.  By specifying one axis to be zero, a hori‐
96       zontal or vertical line can be drawn.  Angles are computed based solely
97       on the coordinate system and ignore the aspect ratio.
98
99       Both functions use these GC components: function, plane-mask, line-
100       width, line-style, cap-style, join-style, fill-style, subwindow-mode,
101       clip-x-origin, clip-y-origin, and clip-mask.  They also use these GC
102       mode-dependent components: foreground, background, tile, stipple, tile-
103       stipple-x-origin, tile-stipple-y-origin, dash-offset, and dash-list.
104
105       XDrawArc and XDrawArcs can generate BadDrawable, BadGC, and BadMatch
106       errors.
107

STRUCTURES

109       The XArc structure contains:
110
111       typedef struct {
112            short x, y;
113            unsigned short width, height;
114            short angle1, angle2;             /* Degrees * 64 */
115       } XArc;
116
117       All x and y members are signed integers.  The width and height members
118       are 16-bit unsigned integers.  You should be careful not to generate
119       coordinates and sizes out of the 16-bit ranges, because the protocol
120       only has 16-bit fields for these values.
121

DIAGNOSTICS

123       BadDrawable
124                 A value for a Drawable argument does not name a defined Win‐
125                 dow or Pixmap.
126
127       BadGC     A value for a GContext argument does not name a defined GCon‐
128                 text.
129
130       BadMatch  An InputOnly window is used as a Drawable.
131
132       BadMatch  Some argument or pair of arguments has the correct type and
133                 range but fails to match in some other way required by the
134                 request.
135

SEE ALSO

137       XDrawLine(3), XDrawPoint(3), XDrawRectangle(3)
138       Xlib - C Language X Interface
139
140
141
142X Version 11                     libX11 1.3.4                      XDrawArc(3)
Impressum