Graphics::FillPie(constBrush*,constRect&,REAL,REAL) method (gdiplusgraphics.h)

The Graphics::FillPie method uses a brush to fill the interior of a pie.

Syntax

Status FillPie(
  [in]      const Brush  *brush,
  [in, ref] const Rect & rect,
  [in]      REAL         startAngle,
  [in]      REAL         sweepAngle
);

Parameters

[in] brush

Type: const Brush*

Pointer to a Brush object that is used to paint the interior of the pie.

[in, ref] rect

Type: const Rect

Reference to a rectangle that bounds the ellipse. A curved portion of the ellipse is the arc of the pie.

[in] startAngle

Type: REAL

Real number that specifies the angle, in degrees, between the x-axis and the starting point of the pie's arc.

[in] sweepAngle

Type: REAL

Real number that specifies the angle, in degrees, between the starting and ending points of the pie's arc.

Return value

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

A pie is a portion of the interior of an ellipse (it is bounded by an elliptical curve and two radial lines). The startAngle and sweepAngle specify the portion of the ellipse to be used.

Examples

The following example defines a pie and then fills it.

VOID Example_FillPie(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a SolidBrush object.
   SolidBrush blackBrush(Color(255, 0, 0, 0));

   // Define the pie shape.
   Rect ellipseRect(0, 0, 200, 100);
   REAL startAngle = 0.0f;
   REAL sweepAngle = 45.0f;

   // Fill the pie.
   graphics.FillPie(&blackBrush, ellipseRect, startAngle, sweepAngle);
}

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusgraphics.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Color

Graphics

Rect

Status