Graphics::FillPie(constBrush*,REAL,REAL,REAL,REAL,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] REAL        x,
  [in] REAL        y,
  [in] REAL        width,
  [in] REAL        height,
  [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] x

Type: REAL

Real number that specifies the x-coordinate of the upper-left corner of the rectangle that bounds the ellipse. A curved portion of the ellipse is the arc of the pie.

[in] y

Type: REAL

Real number that specifies the y-coordinate of the upper-left corner of the rectangle that bounds the ellipse.

[in] width

Type: REAL

Real number that specifies the width of the rectangle that bounds the ellipse.

[in] height

Type: REAL

Real number that specifies the height of the rectangle that bounds the ellipse.

[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_FillPie4(HDC hdc)
{
   Graphics graphics(hdc);

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

   // Define the pie shape.
   REAL x = 0.0f;
   REAL y = 2.0f;
   REAL width = 200.8f;
   REAL height = 100.1f;
   REAL startAngle = 0.0f;
   REAL sweepAngle = 45.7f;

   // Fill the pie.
   graphics.FillPie(&blackBrush, x, y, width, height, 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

Status