Graphics::DrawPie(constPen*,REAL,REAL,REAL,REAL,REAL,REAL) method (gdiplusgraphics.h)
The Graphics::DrawPie method draws a pie.
Syntax
Status DrawPie(
[in] const Pen *pen,
[in] REAL x,
[in] REAL y,
[in] REAL width,
[in] REAL height,
[in] REAL startAngle,
[in] REAL sweepAngle
);
Parameters
[in] pen
Type: const Pen*
Pointer to a pen that is used to draw 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 in which to draw 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 which to draw the pie.
[in] width
Type: REAL
Real number that specifies the width of the rectangle that bounds the ellipse in which to draw the pie.
[in] height
Type: REAL
Real number that specifies the height of the rectangle that bounds the ellipse in which to draw the pie.
[in] startAngle
Type: REAL
Real number that specifies the angle, in degrees, between the x-axis and the starting point of the arc that defines the pie. A positive value specifies clockwise rotation.
[in] sweepAngle
Type: REAL
Real number that specifies the angle, in degrees, between the starting and ending points of the arc that defines the pie. A positive value specifies clockwise rotation.
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
The following illustration shows the pie that is drawn in the ellipse that is bounded by the rectangle. The illustration also shows the horizontal axis of the ellipse and the direction of the startAngle and the sweepAngle.
Examples
The following example draws a pie.
VOID Example_DrawPie4(HDC hdc)
{
Graphics graphics(hdc);
// Create a Pen object.
Pen blackPen(Color(255, 0, 0, 0), 3);
// Define the pie.
REAL x = 0.0f;
REAL y = 0.0f;
REAL width = 200.0f;
REAL height = 100.0f;
REAL startAngle = 0.0f;
REAL sweepAngle = 45.0f;
// Draw the pie.
graphics.DrawPie(&blackPen, 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 |