Drawing a chordΒΆ

Chord()

Draw a chord


SYNTAX

Chord(window_id, left, top, right, bottom, xradial1, yradial1, xradial2, yradial2)

Draw a chord, using the current pen to draw the line and filling it with the current brush.

A chord is a region bounded by the intersection of an ellipse and two line segments. The curve of the chord is defined by an ellipse that fits a bounding rectangle at a specified position. Two radials are also specified - a radial being a line segment drawn from the centre of the ellipse to a specified end point on the ellipse. The curve begins at the point where the ellipse intersects the first radial and extends counter-clockwise to the point where the ellipse intersects the second radial. The chord is closed by a line drawn between the two points where the radials intersect the curve.

window_id

The identifier of the window in which the chord is to be drawn. To print it in the current report, specify NULL instead of a window_id.

The remaining parameters specify the positions of the corners of the rectangle that bounds the ellipse, and of the radials which intersect the ellipse, as follows:

left

The x co-ordinate of the upper-left corner of the bounding rectangle

top

The y co-ordinate of the upper-left corner of the bounding rectangle

right

The x co-ordinate of the lower-right corner of the bounding rectangle

bottom

The y co-ordinate of the lower-right corner of the bounding rectangle

xradial1

The x co-ordinate of the endpoint of the radial defining the beginning of the chord

yradial1

The y co-ordinate of the endpoint of the radial defining the beginning of the chord

xradial2

The x co-ordinate of the endpoint of the radial defining the end of the chord

yradial2

The y co-ordinate of the endpoint of the radial defining the end of the chord


NOTES

  • If the starting point and ending point of the curve are the same, a complete ellipse is drawn.

  • The current position is neither used nor updated by the Chord function.

  • Under Windows 95/98/ME, the sum of the co-ordinates of the bounding rectangle cannot exceed 32.767, and the sum of the left and right or of the top and bottom parameters cannot exceed 32767.


EXAMPLE

In the example on the left the bounding rectangle and the ellipse have also been drawn.

image0

BeginPaint(wintask,10,10)
SetPenColor(wintask, RGB_RED)
SetBrushColor(wintask, RGB_LIME, RGB_WHITE)
SetBrushType(wintask, DB_SOLID)
Rectangle(wintask,30,10,170,100)
SetBrushColor(wintask, RGB_CYAN, RGB_WHITE)
SetPenColor(wintask, RGB_BLACK)
Ellipse(wintask,30,10,170,100)
SetBrushColor(wintask, RGB_RED, RGB_WHITE)
Chord(wintask,30,10,170,100, 50,10,120,80)
Chord(wintask,220,10,360,100, 240,10,310,80)
EndPaint(wintask)

RELATED TOPICS

Drawing operations

Draw functions