1XDrawArc(3X11)                  XLIB FUNCTIONS                  XDrawArc(3X11)
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       0         for normal-angle in the range [0,π2_]
81       π         for normal-angle in the range [π2_,3_π2_]
82       2π        for normal-angle in the range [3_π2_,2π]
83
84       For any given arc, XDrawArc and XDrawArcs do not draw a pixel more than
85       once.  If two arcs join correctly and if the line-width is greater than
86       zero and the arcs intersect, XDrawArc and XDrawArcs do not draw a pixel
87       more than once.  Otherwise, the intersecting pixels of intersecting
88       arcs are drawn multiple times.  Specifying an arc with one endpoint and
89       a clockwise extent draws the same pixels as specifying the other end‐
90       point and an equivalent counterclockwise extent, except as it affects
91       joins.
92
93       If the last point in one arc coincides with the first point in the fol‐
94       lowing arc, the two arcs will join correctly.  If the first point in
95       the first arc coincides with the last point in the last arc, the two
96       arcs will join correctly.  By specifying one axis to be zero, a hori‐
97       zontal or vertical line can be drawn.  Angles are computed based solely
98       on the coordinate system and ignore the aspect ratio.
99
100       Both functions use these GC components: function, plane-mask, line-
101       width, line-style, cap-style, join-style, fill-style, subwindow-mode,
102       clip-x-origin, clip-y-origin, and clip-mask.  They also use these GC
103       mode-dependent components: foreground, background, tile, stipple, tile-
104       stipple-x-origin, tile-stipple-y-origin, dash-offset, and dash-list.
105
106       XDrawArc and XDrawArcs can generate BadDrawable, BadGC, and BadMatch
107       errors.
108

STRUCTURES

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

DIAGNOSTICS

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

SEE ALSO

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