Graphics::FillPie (constBrush*,REAL,REAL,REAL,REAL,REAL,REAL,REAL) 方法 (gdiplusgraphics.h)

Graphics::FillPie 方法使用画笔填充饼图的内部。

语法

Status FillPie(
  [in] const Brush *brush,
  [in] REAL        x,
  [in] REAL        y,
  [in] REAL        width,
  [in] REAL        height,
  [in] REAL        startAngle,
  [in] REAL        sweepAngle
);

参数

[in] brush

类型: const Brush*

指向用于绘制饼图内部的 Brush 对象的指针。

[in] x

类型: REAL

实数,指定边界椭圆的矩形左上角的 x 坐标。 椭圆的曲线部分是饼图的弧线。

[in] y

类型: REAL

实数,指定边界椭圆的矩形左上角的 y 坐标。

[in] width

类型: REAL

实数,指定边界椭圆的矩形的宽度。

[in] height

类型: REAL

实数,指定边界椭圆的矩形的高度。

[in] startAngle

类型: REAL

实数,指定 x 轴与饼弧的起点之间的角度(以度为单位)。

[in] sweepAngle

类型: REAL

实数,指定饼弧的起始点和终点之间的角度(以度为单位)。

返回值

类型: 状态

如果方法成功,则返回 Ok,这是 Status 枚举的元素。

如果 方法失败,它将返回 Status 枚举的其他元素之一。

注解

饼图是椭圆内部的一部分, (它由椭圆曲线和两条径向线) 绑定。 startAnglesweepAngle 指定要使用的椭圆部分。

示例

以下示例定义一个饼图,然后填充它。

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);
}

要求

要求
最低受支持的客户端 Windows XP、Windows 2000 Professional [仅限桌面应用]
最低受支持的服务器 Windows 2000 Server [仅限桌面应用]
目标平台 Windows
标头 gdiplusgraphics.h (包括 Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

另请参阅

颜色

显卡

Status