# Chord function (wingdi.h)

The Chord function draws a chord (a region bounded by the intersection of an ellipse and a line segment, called a secant). The chord is outlined by using the current pen and filled by using the current brush.

## Syntax

``````BOOL Chord(
[in] HDC hdc,
[in] int x1,
[in] int y1,
[in] int x2,
[in] int y2,
[in] int x3,
[in] int y3,
[in] int x4,
[in] int y4
);
``````

## Parameters

`[in] hdc`

A handle to the device context in which the chord appears.

`[in] x1`

The x-coordinate, in logical coordinates, of the upper-left corner of the bounding rectangle.

`[in] y1`

The y-coordinate, in logical coordinates, of the upper-left corner of the bounding rectangle.

`[in] x2`

The x-coordinate, in logical coordinates, of the lower-right corner of the bounding rectangle.

`[in] y2`

The y-coordinate, in logical coordinates, of the lower-right corner of the bounding rectangle.

`[in] x3`

The x-coordinate, in logical coordinates, of the endpoint of the radial defining the beginning of the chord.

`[in] y3`

The y-coordinate, in logical coordinates, of the endpoint of the radial defining the beginning of the chord.

`[in] x4`

The x-coordinate, in logical coordinates, of the endpoint of the radial defining the end of the chord.

`[in] y4`

The y-coordinate, in logical coordinates, of the endpoint of the radial defining the end of the chord.

## Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

## Remarks

The curve of the chord is defined by an ellipse that fits the specified bounding rectangle. The curve begins at the point where the ellipse intersects the first radial and extends counterclockwise to the point where the ellipse intersects the second radial. The chord is closed by drawing a line from the intersection of the first radial and the curve to the intersection of the second radial and the curve.

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 Chord.

## Requirements

Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Library Gdi32.lib
DLL Gdi32.dll