Arc function (wingdi.h)

The Arc function draws an elliptical arc.

Syntax

BOOL Arc(
  HDC hdc,
  int x1,
  int y1,
  int x2,
  int y2,
  int x3,
  int y3,
  int x4,
  int y4
);

Parameters

hdc

A handle to the device context where drawing takes place.

x1

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

y1

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

x2

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

y2

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

x3

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

y3

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

x4

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

y4

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]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

AngleArc

ArcTo

Chord

Ellipse

GetArcDirection

Line and Curve Functions

Lines and Curves Overview

Pie

SetArcDirection