# Pie function (wingdi.h)

The Pie function draws a pie-shaped wedge bounded by the intersection of an ellipse and two radials. The pie is outlined by using the current pen and filled by using the current brush.

## Syntax

``````BOOL Pie(
[in] HDC hdc,
[in] int left,
[in] int top,
[in] int right,
[in] int bottom,
[in] int xr1,
[in] int yr1,
[in] int xr2,
[in] int yr2
);
``````

## Parameters

`[in] hdc`

A handle to the device context.

`[in] left`

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

`[in] top`

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

`[in] right`

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

`[in] bottom`

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

`[in] xr1`

The x-coordinate, in logical coordinates, of the endpoint of the first radial.

`[in] yr1`

The y-coordinate, in logical coordinates, of the endpoint of the first radial.

`[in] xr2`

The x-coordinate, in logical coordinates, of the endpoint of the second radial.

`[in] yr2`

The y-coordinate, in logical coordinates, of the endpoint of the second radial.

## 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 pie 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 current position is neither used nor updated by the Pie function.

## Requirements

Requirement Value
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