Graphics::D rawPie 方法绘制饼图。
语法
Status DrawPie(
  [in]      const Pen    *pen,
  [in, ref] const Rect & rect,
  [in]      REAL         startAngle,
  [in]      REAL         sweepAngle
);
参数
[in] pen
类型: const 触控笔*
指向用于绘制饼图的笔的指针。
[in, ref] rect
类型: const Rect
引用一个矩形,该矩形绑定了要在其中绘制饼图的椭圆。
[in] startAngle
类型: REAL
实数,指定 x 轴与定义饼图的弧线起点之间的角度(以度为单位)。 正值指定顺时针旋转。
[in] sweepAngle
类型: REAL
实数,指定定义饼图的弧线的起始点和终点之间的角度(以度为单位)。 正值指定顺时针旋转。
返回值
类型: 状态
如果方法成功,则返回 Ok,这是 Status 枚举的元素。
如果 方法失败,它将返回 Status 枚举的其他元素之一。
注解
下图显示了在矩形边界的椭圆中绘制的饼图。 该图还显示了椭圆的水平轴以及 startAngle 和 sweepAngle 的方向。
              
            
示例
以下示例绘制一个饼图。
VOID Example_DrawPie(HDC hdc)
{
   Graphics graphics(hdc);
   // Create a Pen object.
   Pen blackPen(Color(255, 0, 0, 0), 3);
   // Define the pie.
   Rect ellipseRect(0, 0, 200, 100);
   REAL startAngle = 0.0f;
   REAL sweepAngle = 45.0f;
   // Draw the pie.
   graphics.DrawPie(&blackPen, ellipseRect, startAngle, sweepAngle);
}
要求
| 要求 | 值 | 
|---|---|
| 最低受支持的客户端 | Windows XP、Windows 2000 Professional [仅限桌面应用] | 
| 最低受支持的服务器 | Windows 2000 Server [仅限桌面应用] | 
| 目标平台 | Windows | 
| 标头 | gdiplusgraphics.h (包括 Gdiplus.h) | 
| Library | Gdiplus.lib | 
| DLL | Gdiplus.dll |