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

Integer 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: INT

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

[in] width

Type: INT

Integer that specifies the width of the rectangle that bounds the ellipse.

[in] height

Type: INT

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

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

   // Define the pie shape.
   int x = 0;
   int y = 0;
   int width = 200;
   int height = 100;
   REAL startAngle = 0.0f;
   REAL sweepAngle = 45.0f;

   // 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