Share via


Graphics.FillPie(const Brush*, RectF, REAL, REAL) method

Applies to: desktop apps only

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

Syntax

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

Parameters

  • brush [in]
    Type: const Brush*

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

  • rect [in, ref]
    Type: RectF

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

  • startAngle [in]
    Type: REAL

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

  • sweepAngle [in]
    Type: REAL

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

Return value

Type:

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

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

   // Define the pie shape.
   RectF ellipseRect(0.5f, 0.8f, 200.9f, 100.6f);
   REAL startAngle = 0.0;
   REAL sweepAngle = 45.8;

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

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics

Color

Rect

Status

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012