# Arc function

The Arc function draws an elliptical arc.

## Syntax

```
BOOL Arc(
_In_ HDC hdc,
_In_ int nLeftRect,
_In_ int nTopRect,
_In_ int nRightRect,
_In_ int nBottomRect,
_In_ int nXStartArc,
_In_ int nYStartArc,
_In_ int nXEndArc,
_In_ int nYEndArc
);

```

## Parameters

hdc [in]

A handle to the device context where drawing takes place.

nLeftRect [in]

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

nTopRect [in]

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

nRightRect [in]

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

nBottomRect [in]

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

nXStartArc [in]

The x-coordinate, in logical units, of the ending point of the radial line defining the starting point of the arc.

nYStartArc [in]

The y-coordinate, in logical units, of the ending point of the radial line defining the starting point of the arc.

nXEndArc [in]

The x-coordinate, in logical units, of the ending point of the radial line defining the ending point of the arc.

nYEndArc [in]

The y-coordinate, in logical units, of the ending point of the radial line defining the ending point of the arc.

## Return value

If the arc is drawn, the return value is nonzero.

If the arc is not drawn, the return value is zero.

## Remarks

The points (nLeftRect, nTopRect) and (nRightRect, nBottomRect) specify the bounding rectangle. An ellipse formed by the specified bounding rectangle defines the curve of the arc. The arc extends in the current drawing direction from the point where it intersects the radial from the center of the bounding rectangle to the (nXStartArc, nYStartArc) point. The arc ends where it intersects the radial from the center of the bounding rectangle to the (nXEndArc, nYEndArc) point. If the starting point and ending point are the same, a complete ellipse is drawn.

The arc is drawn using the current pen; it is not filled.

The current position is neither used nor updated by Arc.

Use the GetArcDirection and SetArcDirection functions to get and set the current drawing direction for a device context. The default drawing direction is counterclockwise.

## Requirements

 Minimum supported client Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only] Wingdi.h (include Windows.h) Gdi32.lib Gdi32.dll

Lines and Curves Overview
Line and Curve Functions
AngleArc
ArcTo
Chord
Ellipse
GetArcDirection
Pie
SetArcDirection

Show: